24.04.2013, 05:11
(
Последний раз редактировалось Hawkseye; 24.04.2013 в 05:44.
)
Right, so I'm wanting to save specific item ID's contained in an inventory using an integer array. Pretty simple.. although this ain't working. At all. I've only just converted over to using MySQL from dini so I'm not very familiar with php. Is this even possible with MySQL? Any help would be quite wonderful.
SQL Error log:
I've considered just creating a new column for each of the 35 values but I appreciate things being more organized if I can help it.
Код:
new cnt; while(cnt <= 35) //Max Business inventory slots { format(query, sizeof(query),"UPDATE `businesses` SET `Inventory[%d]`= %d WHERE `SQLID`= %d ;",cnt, -1 ,i); mysql_query(query); cnt++; }
Код:
[00:12:12] CMySQLHandler::Query(UPDATE `businesses` SET `Inventory (35)`= '-1' WHERE `SQLID`=2 ;) - An error has occured. (Error ID: 1054, Unknown column 'Inventory[35]' in 'field list') [00:12:12] >> mysql_query( Connection handle: 1 )