01.02.2014, 22:03
hey,
got a problem with INSERT INTO
here's the command
But the output in the console is:
Where's the mistake?
best regardz
got a problem with INSERT INTO
Код:
format(query, sizeof(query), "INSERT INTO `cars` (`owner`, `spawnx`, `spawny`, `spawnz`, `spawnr`, `modelid`, `c1`,`c2`) VALUES ('%s', '%f', '%f', '%f', '%f', '%d', '%d', '%d')", SpielerName(playerid), x, y, z, a,modelid, c1, c2);
Код:
ocmd:savecar(playerid, params[]) { #pragma unused params new Float:x,Float:y,Float:z,Float:a,co1,co2,query[500]; new vehicleid = GetVehicleModel(vehicleid); new v = GetPlayerVehicleID(playerid); GetVehiclePos(vehicleid,x,y,z); GetVehicleZAngle(vehicleid, a); GetVehicleColor(v, co1, co2); format(query, sizeof(query), "INSERT INTO `cars` (`owner`, `spawnx`, `spawny`, `spawnz`, `spawnr`, `modelid`, `c1`,`c2`) VALUES ('%s', '%f', '%f', '%f', '%f', '%d', '%d', '%d')", SpielerName(playerid), x, y, z, a,modelid, c1, c2); mysql_query(query); printf(" %s ", query); RemovePlayerFromVehicle(playerid); return 1; }
Код:
INSERT INTO `cars` (`owner`, `spawnx`, `spawny`, `spawnz`, `spawnr`, `modelid`, `c1`,`c2`) VALUES ('testuser', '0.000000', '0.000000', '0.000000', '0.000000', '48', '49', '50')
best regardz