|
Posted by linda on 11/17/06 18:50
"linda" <n0spamF0rme@tiscali.co.uk> wrote in message
news:455e02f0_1@mk-nntp-2.news.uk.tiscali.com...
> sigh.... can anyone see where I've made the mistake?
>
> $query = "INSERT INTO user_login
> ('name','email','date_of_birth','password','registration_date') VALUES
> ('$name', '$email', '$date_of_birth', MD5('$password'), NOW())";
>
> $result = mysql_query($query);
> if(!$result)
> {
> die("Query failed: $query - " . mysql_error());
> }
> elseif(mysql_affected_rows() == 0)
> {
> die("Query syntax OK, but no rows updated: $query");
> }
>
> mysql_close();
>
>
> As I'm getting this error:
>
> Query failed: INSERT INTO user_login
> ('name','email','date_of_birth','password','registration_date') VALUES
> ('linda', 'linda@anemailaddress.co.uk', '2006-1-1', MD5('test'), NOW()) -
> You have an error in your SQL syntax; check the manual that corresponds to
> your MySQL server version for the right syntax to use near
> ''name','email','date_of_birth','password','registration_date') V
>
It's ok i've sorted it now, I removed the ticks around the fields names and
it work fine. Thank you for all your help J.O.Aho.
Have a great weekend,
Linda
Navigation:
[Reply to this message]
|