开发者

htmlspecialchars or mysql_real_escape_string?

开发者 https://www.devze.com 2023-01-14 05:49 出处:网络
I am unsure which one to use in this situation??? $query1 = \"SELECT * FROM messages WHERE messages.custid=\'\".htmlspecialchars($_SESSION[\'custo开发者_如何转开发merid\']).\"\'

I am unsure which one to use in this situation???

$query1 = "SELECT * FROM messages WHERE 
messages.custid='".htmlspecialchars($_SESSION['custo开发者_如何转开发merid'])."' 
ORDER BY messages.id LIMIT $start, $limit ";


use mysql_real_escape_string .. But really, don't do that

instead, install Pear's PDO library, then use a prepared statement for your query


mysql_real_escape_string() is made especialy for Mysql Tables, as the name indicates ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消