Inserting values from PHP.

2002-11-19 Thread Damien Buttler
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

Re: Inserting values from PHP.

2002-11-19 Thread Ryan Fox
- 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

Re: Inserting values from PHP.

2002-11-19 Thread Daniel Kasak
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

Re: Inserting values from PHP.

2002-11-19 Thread Justin French
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