Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 执行INSERT语句时,Propel ORM返回错误_Php_Propel - Fatal编程技术网

Php 执行INSERT语句时,Propel ORM返回错误

Php 执行INSERT语句时,Propel ORM返回错误,php,propel,Php,Propel,我有一个schema.xmlconfig: <?xml version="1.0" encoding="UTF-8"?> <database name="manager" defaultIdMethod="native"> <table name="users" phpName="Users"> <column name="id" type="integer" required="true" primaryKey="true" a

我有一个
schema.xml
config:

<?xml version="1.0" encoding="UTF-8"?>
<database name="manager" defaultIdMethod="native">
    <table name="users" phpName="Users">
        <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />  
        <column name="name" type="varchar" size="128" required="true" />
        <column name="desc" type="longvarchar" required="true" />
    </table>
</database>
我得到了这个错误

Unable to execute INSERT statement [INSERT INTO users (id, name, desc) VALUES (:p0, :p1, :p2)]
我使用最新版本的slim框架和最新版本的Propel ORM。我在2个月前写了这个脚本,它可以正常工作,但现在我安装了它,它不工作了,因为我不能执行任何Insert语句。为什么?


谢谢。

可能是
desc
被解释为语法错误,因为它是一个保留字,也许可以尝试将
desc
重命名为其他名称,例如
Description

从配置和代码之间我可以看到,如果执行
$user->setDesc(“非空值”),会发生什么情况
?@sjagr如果setDesc为非空值,我会得到相同的错误。@PatrickBurns您是否尝试过直接运行原始/失败语句?这里可能还有一些可能的问题
description
是MySQL的一个保留字,用于
description
ing表,在这种情况下,您应该尝试将
description
更改为其长格式
description
另一种可能是当前的查询没有用反勾转义列名
Unable to execute INSERT statement [INSERT INTO users (id, name, desc) VALUES (:p0, :p1, :p2)]