LoginSignup
4
3

More than 5 years have passed since last update.

PDO::prepareで部分一致(like %...%)させる時にエラーになる

Posted at

つまり $name の中に %がなくてはいけません

$query="SELECT * FROM table WHERE id=:id OR like name= :name ";
にして
$name = "%文%";
にすれば良い
ってことです

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3