LIKEを使う場合にプレースホルダが効かずに悩んでいました:
ダメな例1:
ng1.php
$sql = "SELECT * FROM shops WHERE name LIKE '%?%'";
$results = $this->query($sql, array('原宿') );
ダメな例2:
ng2.php
$sql = "SELECT * FROM shops WHERE name LIKE %?%";
$results = $this->query($sql, array('原宿') );
正しい書き方:
ok.php
$sql = "SELECT * FROM shops WHERE name LIKE ?";
$results = $this->query($sql, array('原宿') );