This insert query looks to be alright, however I get this error:
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key, online) VALUES ('0', '8', 'nothing@poop.com', 'first', 'last', 'a3' at line 1
Here is the actually query:
Code: <?php
//This is only a snippet
function makeKey($id){
$key .= $id.rand(0, 10); //To Be Unique
for($j=0; $j<=3; $j++){
$key .= rand(11, 20);
}
for($k=0; $k<=3; $k++){
$key .= rand(21, 30);
}
return $key;
}
$key = makeKey($id);
mysql_query("
INSERT INTO ".TBL_PEOPLE." (id, level, email, first, last, password, activated, key, online)
VALUES ('$id', '$level', '$db_email', '$db_first', '$db_last', '$db_pass', '0', '$key', '0')
")or die(mysql_error());
?>
Any ideas? Maybe I am just tired.
what does this mean? +=
is anyone able to explain what this code is saying?i had it written for me awhile back and now that i wanna change it about to make it my own etc i dont really know what each part is doing...
Curly Bracket Delimeters.
I'd always believed that the starting and ending delimeters in preg_ functions had to be the same character, but recently discovered that you can use the curly brackets.Example:Code:
"From field" in PHP email form
I used a wizard to create a PHP email form. I was able to customize it with the exception of the From field. I need the email that is sent to be "From" the email that the sender input.
trim function issues
Hi guys, total noob here... So I've been tinkering around with a html and am using php to email the subitted data to me. It's all working fine, except now I've changed the rules of the form a little
if statements problems
Hi. I'm trying to make a web form, but I kind of hit a dead end trying to figure out why it doesn't work. Basically, I'm trying to read from a file and then populate the form according to the file.The
how do I show what a user have selected from a checkbox?
From my code below, how would i show which check boxes have been checked and which radio buttons selected?Code:
2 things: enter doesn't work in IE & empty form
i have this search form that works well except for 2 things.1) on IE when i hit enter instead of the Submit button, i do not get any result. with firefox, no problem.2) when i hit submit or enter
Procedure with variable number of columns
Hi, I have a procedure that looks like this:
Retreiving objects from Sessions
Hi all,I am getting really frustrated with storing and retreiving objects from a session. But it may be because of my lack of knowledge in sessions First some system specs:OS - Vista Home
Remove values in array2 from array1
I have two arrays.Array 1 is where the array key holds various different numbers. For example:Code: [Select]$array[32] = 1;$array[122] = 1;$array[238] = 1;$array[324] = 1;The other array holds values