26.03.2011, 19:08
well...
I made my own house system for my server...
however as there were a few wrongly saved houses, which I deleted the "auto increment" got f*cked up and it saved them as id 49, 50, 53, 54, etc...
and I couldn't add a 51 and 52... just could change the IDs later, however then I can also manually add them to the list if I have to check it again and again..
so to the current story:
I've disabled the auto increment and am using this code now:
I'm using stricken's plugin (the first ID is '0', so - to my knowledge - I can use 'row' as the ID)...
the mysql log says this:
any idea what's wrong?
I made my own house system for my server...
however as there were a few wrongly saved houses, which I deleted the "auto increment" got f*cked up and it saved them as id 49, 50, 53, 54, etc...
and I couldn't add a 51 and 52... just could change the IDs later, however then I can also manually add them to the list if I have to check it again and again..
so to the current story:
I've disabled the auto increment and am using this code now:
pawn Код:
format(query, sizeof(query), "SELECT * FROM `Houses`");
mysql_query(query);
mysql_store_result();
new row = mysql_num_rows();
mysql_free_result();
format(query, sizeof(query), "INSERT INTO `Houses` (`id`, `Price`, `x`, `y`, `z`) VALUES ('%d', '%f', '%f', '%f')",row, price, x, y, z);
mysql_query(query);
the mysql log says this:
pawn Код:
Error (0): Failed to exeute query. Column count doesn't match value count at row 1.