Forum Moderators: coopster

Message Too Old, No Replies

Unknown Column in mysql?

recieving unknown column error, but works elsewhere

         

Krys

11:16 pm on May 1, 2009 (gmt 0)

10+ Year Member



UPDATE custom_shop SET base_restock = '2', restock_multiplyer = '1', restock_max = '10', restock_freq = '1800', price = '1', min_price = '1', currency = 'zultanite' WHERE item_id = '12'

I get the error "Unknown column 'item_id' in 'where clause'" when trying to run that.

I'm likely overlooking something silly, but I'm trying to run the preceding query through a script, and it's not working. It worked before, and all I've added is the "currency = '____' " bit since then.

If I paste the query into phpmyadmin, and change the beginning to "SELECT * FROM custom_shop" (so that I know for a fact the WHERE clause is the same) it works.

running the query as is in php myadmin simply affects no rows, but does not return an error. Any suggestions?

[edited by: Krys at 11:18 pm (utc) on May 1, 2009]

eeek

11:57 pm on May 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I get the error "Unknown column 'item_id' in 'where clause'" when trying to run that.

So, asking the obvious, is their a item_id column in the custom_shop table?

xKillswitchx

6:46 am on May 5, 2009 (gmt 0)

10+ Year Member



I get this from time to time myself and it seems to fix if I add backticks ` on the fields...

SELECT `whatever FROM TABLE_X WHERE `item_id` = 12

All I can think of if you say the fields exist in the table.