I hope someone can help. I have written a PHP script which adds a row to a
MySQL table. The columns are all of type 'char'. The script works fine
when only numerical values are passed, but when I try to pass values a-z A-Z
the script fails. When I attempt to add the same values straight
- Original Message -
From: Damien Buttler [EMAIL PROTECTED]
I hope someone can help. I have written a PHP script which adds a row to
a
MySQL table. The columns are all of type 'char'. The script works fine
when only numerical values are passed, but when I try to pass values a-z
A-Z
Damien Buttler wrote:
I hope someone can help. I have written a PHP script which adds a row
to a MySQL table. The columns are all of type 'char'. The script
works fine when only numerical values are passed, but when I try to
pass values a-z A-Z the script fails. When I attempt to add the
Try closing them in single quotes.
?
$v1 = 'foo';
$v2 = {$v1} bah;
$sql = INSERT INTO table_name (colname1, colname2) VALUES ('$v1', '$v2');
$result = mysql_query($sql)
...
?
If that doesn't work, perhaps you need to add_slashes() to each value before
inserting, or read up on magic quote in the