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 PHP manual.
Cheers,
Justin
on 20/11/02 10:37 AM, Damien Buttler ([EMAIL PROTECTED]) 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 same values straight from the
> MySQL CLI it also works.
>
> Any help would be appreciated.
>
> Thanks,
> Damien.
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
Justin French
--------------------
http://Indent.com.au
Web Developent &
Graphic Design
--------------------
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php