If this is an exact copy of your script, then you've surrounded each
variable name in the VALUES(...) with back-ticks. Why?
-----Original Message-----
From: plague [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 24, 2001 12:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Variables in MySQL Insert Queries
I am using this code to connect to my database and insert form data from a
user:
$connect = mysql_connect("myhost","user","pass") or die (" not connected");
@mysql_select_db("dbname");
$sql="INSERT INTO tablename
(id,first,last,age,email,sfuser,sfship,icq,ac,loca,ref)
Values(,`$first`,`$last`,'$age',`$email`,`$sfuser`,`$sfship`,`$icq`,`$ac`,`$
loca`,`$ref`)";
echo (mysql_affected_rows()?"success":"failure");
mysql_close($connect);
The script returns "success" except for it doesn't insert the data ( from a
form ).
The age column is BLOB, not INT.
I would really appreciate the help of someone, as this has really stumped
me.
Thanks,
plague
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]