Mixing sprintf and mysql_real_escape_string

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

 



Hi,

I get strange output if I combine sprintf and mysql_real_escape_string. If I
do this the resulting into the database is \' not ' as I want.

mysql_query(sprintf("INSERT INTO table (value1, value2) VALUES (1, '%s')",
mysql_real_escape_string(" ' ")));

Should this be like this? Do the sprintf already add slashes or something?

/Peter

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux