This is driving me nuts!


Posted on 16th Feb 2014 07:03 pm by admin

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.

No comments posted yet

Your Answer:

Login to answer
191 Like 35 Dislike
Previous forums Next forums
Other forums

need help in mysql_num_rows()
please tell me what i am doing wrong in this query. it displays this error

Code: Warning: mys

Automatically Detect Phone Model for WAP Jar Deployment
Making a wap site is fairly simple, but I'd like to know if there's a way to make it so that the wap

calendar dates and hours compare problem
i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same

Need help-Error istream header declaration
Hi Everyone ,

I am having issue with istream declaration. I am new to C programming.
can a

what business processes?
Hi,

A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)

unoconv doc convert to pdf code prob
PHP/5.3.1

Hi. I am trying to use this code to convert docs to .pdf utilizing unoconv. Howe

script and html conflict in trying to create a header.
I have an error is occurring because of an html webpage with a "php require" at the top of

Need help in Generating Combinations
Need help generating all possible combination of names in an array

Lets say i have the follow

php redirecting
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt

PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash