LoginSignup
1
1

More than 5 years have passed since last update.

PDOのよく判らなかった挙動

Last updated at Posted at 2014-01-24

PDO

    $sth->bindValue(':value', $this->value . "%" , \PDO::PARAM_STR);

=> 想定どおりに動作しない(前方一致にならず、無指定の"%"扱いっぽく検索される)

    $search_val = $this->value . "%";
    $sth->bindValue(':value', $search_val , \PDO::PARAM_STR);

=> ちゃんと動く。

なんで?

1
1
2

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
1
1