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

Issue Parsing XML into table
Hello all,

Im a bit new to php and new to phpfreaks. But thanks in advance for the help!
<

Beginner PHP code help
Hi I'm new to php but if someone could please read the question below and help it would be great.

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

Help If user voted, block them
On my Prayer request site, i let users Click a button to Pray for somone that has posted a pray, i g

mysql VARCHAR acting like INT
Hi, All.

I have a table that contains a varchar(10) column named weird_field. In this column

Program with calculate Meteorologic measurements
Hello I'm a beginner and I want to make a program with calculate Meteorologic measurements:
ba

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to

Select question
Hi,

First I would like to say that php is pretty new for me..
so please don't shoot me if

SAP Logon Failed
I tried to login to SAP through MMC.

When i click start and give password.

it

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