sqlite - PHP - PDO SQLite3 Prepared Statements -


I am trying to use a statement prepared in PHP script which uses a SQLite3 database PDO.

The normal version of this query works as expected:

  $ q1 = "SELECT COUNT (*) frame where name = 'apple'"; Echo $ db- & gt; Query ($ q1) - & gt; Fetch column ();  

However, my finished version version does not show anything.

  $ q2 = "SELECT COUNT (*) from frame where name = '?'"; $ S = $ db- & gt; Prepare ($ q2); $ S- & gt; But execution ("apple"); Echo $ s- & gt; Fetch column ();  

What am I doing wrong? I tried it with both PHP 5.2 and PHP 5.3 with the same result.

I think that you do not do this before and after it requires additional epoprop? And you should use an array: $ s-> Execution (array ("apple"));


Comments