2010年7月25日星期日

Re: [fw-db] Column not found: 1054 Unknown column '00nk01' in 'where clause

On Jul 25, 2010, at 4:02 PM, gpcola wrote:

> Zend_Db_Adapter_Abstract->update('products', Array, 'sku = 00nk01') #5
> C:\xampp\htdocs\sinfulthrills\cron_scripts\products\init
> \getss365products.php(441):
> Product->updateProduct(Array) #6

Looking at your stack trace, I find the lines above.

The error isn't caused by a SELECT statement, it's caused by an UPDATE
statement.

It looks like you are setting 'sku = 00nk01'. I assume 00nk01 is a
value, but it's not in quotes. Well, it's in PHP quotes but it's not
in quotes in the resulting SQL expression. So it's treating it as a
column name, and giving you an error.

Regards,
Bill Karwin

没有评论: