sOnt
sOnt

Reputation: 97

SQLite3 Prepared Statement in PHP5

I am trying to use prepared statements for a select query in php for an sqlite3 database but without any success. I'm trying it with the following code:

$db = new SQLite3('/var/www/sqlite/data.db');
$link = "http://127.0.0.1";
$stmt = $db->prepare('SELECT * FROM table WHERE link = (?)');
$stmt->bindValue(1, $link, SQLITE3_TEXT);
$result = $stmt->execute();
var_dump($result);

No result.

object(SQLite3Result)#3 (0) { }

What is wrong with the code above?

Upvotes: 0

Views: 397

Answers (1)

Gerard H. Pille
Gerard H. Pille

Reputation: 2578

You should fetch the results:

var_dump($result->fetchArray());

Upvotes: 1

Related Questions