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

Implementing Single Sign-On using SAML 1.1, x.509, LDAP in C#.net
Hi, I got a requirement from the client i.e implementing single sing on using SAML 1.1( LDAP &

help countdown timers
hello every one,

I'd like to know how to insert many countdowns in the same page.
The dura

Displaying Multidimensional Arrays...about to put my head in a vice, PLEASE HELP
I am fairly new to PHP and MySQL and I have a problem which I have been trying to resolve for days.

php email checker
I am having alot of trouble finding info on how to do these email things. I need to do the following

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe

CURL question
i am wondering if it's possible to use multi curl with login something like

login once to web

WHYISNT THIS MYSQL STATEMNT NOT WORKING? (php)
caps because its absolutely rediculous.
i dontunderstand why its not working. there is a column c

getAlexaRank($url) function not working
I have made a function to get alexa rank
the site is here: http://mytestsite.rack111.com/1

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