【发布时间】:2013-06-08 13:18:49
【问题描述】:
我是第一次使用 sqlite。
准备一个类似的查询字符串
$articleInsertQuery = "INSERT INTO Articles VALUES (?, ?, ?, ?, ?)", ($i, $title, $content, $date, 93,);
它返回“解析错误”。我也尝试过不通过像
这样的参数化查询$articleInsertQuery = "INSERT INTO Articles VALUES ($i, $title, $content, $date, 93)";
得到"Unable to prepare statement: 1, unrecognized token: ":" "
知道我哪里做错了吗?
【问题讨论】:
-
您是否使用任何功能来做到这一点?如果是这样,请告诉我们。
-
$query = $dbObject->prepare($articleInsertQuery); $query->execute();
-
嘿@arnold,来自哪个班级?
-
class AppDBClass extends SQLite3{ function __construct() { $this->open('../Server/db/sqlite3_database.db'); } } 和 $dbObject = new AppDBClass();