/    Sign up×
Community /Pin to ProfileBookmark

adding the word NO – simple

my page uploads all of the forms data into the database, however when it does this i also want it to upload the word NO into a field called valid in each record. What is the correct syntax

$firstname = $_POST[‘firstname’];
$lastname = $_
POST[‘lastname’];
$username = $_POST[‘username’];
$password = $_
POST[‘password’];

BUT WHAT DO I PUT AFTER THOSE TO ADD ‘NO’ TO ALL THE valid FIELDS

i’ve tried

$valid = ‘NO’;

but it doesn’t work

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@oo7mlauthorMay 11.2007 — Here is my code:

[code=php]//retrieve form data in a variable
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$password = $_POST['password'];
$DOB = date("Y-m-d", mktime(0,0,0,$_POST['DOBmm'],$_POST['DOBdd'],$_POST['DOByyyy'])); // keep the DOB as one
$gender = $_POST['gender'];
$county = $_POST['county'];
$college = $_POST['college'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$file = $_POST['file'];
$about_me = $_POST['about_me'];
//$vaild = 'NO';


// Insert info into the table
mysql_query("INSERT INTO accounts
(firstname, lastname, username, password, dob, gender, county, college, mobile, email, file, about_me, valid) VALUES( '$firstname' , '$lastname' , '$username', '$password', '$DOB', '$gender', '$county', '$college', '$mobile', '$email', '$uploadFilename', '$about_me', '$valid') "); [/code]
Copy linkTweet thisAlerts:
@kurniawanMay 11.2007 — Isn't this problem?

[code=php]//$vaild = 'NO';[/code]

It should be :

[code=php]$valid = 'NO';[/code]

you mistype it. ?

You may also write it directly as [B]'NO'[/B] instead of [B]'$valid'[/B] inside mysql command.


------------------------------------------------
http://anaknegri.com http://pajaknenkin.com http://arifkurniawan.net

http://ppi-kansai.net http://kti2007.ppi-kansai.net
Copy linkTweet thisAlerts:
@oo7mlauthorMay 11.2007 — Oh no way, sorry about that, i can't believe that, thanks for your help
Copy linkTweet thisAlerts:
@kurniawanMay 11.2007 — We all make mistakes ?
×

Success!

Help @oo7ml spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...