奇怪的问题
INSERT INTO categories ("name", "parent", "name_en", "stocks_num", "price_in", "price_out", "factory") VALUES ('计算器', 0, 'jsq', , , , '');
使用 pg_last_error() 函数返回:
ERROR: syntax error at or near "," LINE 1: ...rice_out", "factory") VALUES ('计算器', 0, 'jsq', , , , ''); ^
如果使用 pg_admin3, 执行上面的 sql 语句得到
ERROR: syntax error at or near "insert"
LINE 1: insert INTO categories ("name", "parent", "name_en", "sto...
^
问题可能出在上面有好几个变量为空, 如果这几个变量均有值的话,则可以顺利插入到数据库中.