Re: Insert path string into Mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, November 18, 2002, at 01:10  PM, Alan Kelly wrote:
$path = 'c:\\demo\\' ;
$query = "insert into PH_PHOTO (PHOTO_PATH) VALUES ('$path')";

$result=mysql_query($query);
I would guess that the backslashes are being interpreted once by php when the variable $path is interpolated into the query string (to become c:\demo\) and again by mysql at which point it tries to insert a value for \d. You might try $path = 'c:\\\\demo\\\\' and see if that works. Or maybe leave the path alone and do the query line like this:

$query = "insert into PH_PHOTO (PHOTO_PATH) VALUES ('" . $path . "')";

-Steve


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux