Query problem.
#1

Wth is wrong with this query? I give a cookie to whoever tell me

pawn Код:
format(query, sizeof(query), "INSERT INTO `ownedcars` (`Model`, `Color1`, `Color2`, `Price`, `Owner`, `PosX`, `PosY`, `PosZ`, `PosA`, `Plate`, `bPrice`) VALUES ('%i', -1, -1, 0, '%s', '%f', '%f', '%f', '%f', '%s', '%d')", cModel, pname, X, Y, Z, A, pname, cPrice);
    mysql_query(query);
Reply
#2

What error you get?
Reply
#3

pawn Код:
mysql_debug(1);
format(query, sizeof(query), "INSERT INTO `ownedcars` (`Model`, `Color1`, `Color2`, `Price`, `Owner`, `PosX`, `PosY`, `PosZ`, `PosA`, `Plate`, `bPrice`) VALUES ('%i', -1, -1, 0, '%s', '%f', '%f', '%f', '%f', '%s', '%d')", cModel, pname, X, Y, Z, A, pname, cPrice);
mysql_query(query);
mysql_debug(0);
Put this, then goto the mysql_log (in your server's folder) and post here what has been logged
Reply
#4

[Sun Apr 10 16:42:14 2011] Error (0): Failed to exeute query. Duplicate entry '0' for key 1.
Reply
#5

Dude, you know as much as i do. All that that query is supposed to do is enter data into a mysql database. I dont have any clue whats going on with it.
Reply
#6

You need to set auto increment for a key ..
http://dev.mysql.com/doc/refman/5.1/...increment.html
Reply
#7

Owww, opps, lol. Im tired so im not thinking. Lol. Ok thx i got it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)