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

Impact of movement type 412 E on MAP
Hi

Usage of movement type 412 E is causing huge change in MAP .

Is there any r

multipart emiail forms
Hi All,

I am new to the boards and I've been working on a form (which is rather massive, imo

Strange php code found on my website
I got hacked and the following code was placed within my files:

Code: [Select]<?
/*

MASS PM
Hello all, I'm trying to send mass private messages to users in my database but keep getting an erro

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

FILTER_CALLBACK -- Files?
Hi All,

I'm using the php filter functions to validate my form data. For custom filters, I'm

Where is my php.ini???
Hi

First off - apologies - i'm not a coder so this may sound very amateur.

I'm having

Calling a Procedure with IN & OUT Parameters
Hello,

I usually call my procedures using the following way

declare variable e

Saas with SAP R/3
hi experts,

Is SaaS offer available in SAP? for SAP R/3? from where i can get the info a

Inserting a variable in a link
I have this code that I want to insert for my own variable but I have no idea how. This is what I wa

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