Y.J.I
Hello,everyone. I am living in Taiwan.
Thursday, October 18, 2012
PDO使用時要注意
使用prepare
在execute若有LIKE條件時
%必須放到excute參數內
放在原始$sql會出錯
$sql = "SELECT id,full_xxxx_name
FROM xxxx
WHERE full_xxxx_name LIKE :xxxx_name;";
$statement = $connection->prepare($sql);
$statement->execute(array(':xxxx_name' => $inputname."%"));
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment