我试图插入过程中使用的late static binding concept,但我得到的时候我写这条语句语法错误: 我使用的PHP版本5.3.8追加SQL查询中静态变量
$resultArray = $this->connection->query("insert into " static::$table "(title,link) values('hi','hello')");
我试图插入过程中使用的late static binding concept,但我得到的时候我写这条语句语法错误: 我使用的PHP版本5.3.8追加SQL查询中静态变量
$resultArray = $this->connection->query("insert into " static::$table "(title,link) values('hi','hello')");
看起来像与查询字符串的其余部分一起忘记了一些点到concatenatestatic::$table
。试试这个:
$resultArray = $this->connection->query("insert into " . static::$table . "(title,link) values('hi','hello')");
你能编辑你的问题来包含错误信息吗? – 2015-02-11 12:50:24