简体   繁体   中英

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?

您应该获取结果:

var_dump($result->fetchArray());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM