1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

1
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?