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

Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....

Warning: session_start() [fu

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

Using mysql_real_escape_string for displayed content
On my website users can input data into a textarea and it will store it in the mysql database. But,

PHP Captcha Error help - replace the "die" command
Hi All,

I am after a bit of help with a Captcha spam protection box.

The site gave me

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

help with this code please?
Hello,

I am trying to build a remote upload script for my image hosting site.

I am usi

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

Drop Down and text box issue
Is it possible to set a drop down list and text boxes to a certain width?

here is my code

how to export excel file in same server
My first post - php newbie, so appreciate your support.

I'm currently using headers to save w

Why doesn't this work? (SSH2)
This is my script:

Code: <?php
$connection = ssh2_connect('213.251.167.109', 22);

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