24.12.2013, 13:26
I've talked about this error on my other topic, but I decided to post it as new one for few motivations:
-The old topic contains a title of problem that have been fixed
-This new topic with new name can be found by someone else that got my same problem
After that, here's my problem, I'm trying to make a Dynamic car system, I've made the DB, and every thing, when you buy the vehicle it run this query
It just works fine, I've checked the DB and no problem here
But then, I try to Select the information to take the SQLid (the unique ID) from tID (temp ID, taken from GetPlayerVehicleID)
With this query
On SetPlate I do:
It always return no rows, but printing the query and just do a copy / paste to the SQL Executer it shows the line, without giving error...
-The old topic contains a title of problem that have been fixed
-This new topic with new name can be found by someone else that got my same problem
After that, here's my problem, I'm trying to make a Dynamic car system, I've made the DB, and every thing, when you buy the vehicle it run this query
pawn Код:
//Called on the command to create the Vehicle
format(query, sizeof(query), "INSERT INTO car(Owner, Model, Price, Col1, Col2, cLock, cX, cY, cZ, cA, tID) VALUES ('%s', '%d', '%d', '%d', '%d', '%d', '%f', '%f', '%f', '%f', '%d')",
RUS(playerid), //Name w/out '_'
model,
price,
Car[id][cCol1],
Car[id][cCol2],
Car[id][cLock],
Car[id][cX],
Car[id][cY],
Car[id][cZ],
Car[id][cA],
id);
print(query); // DEBUG
mysql_function_query(connection, query, false, "", "");
But then, I try to Select the information to take the SQLid (the unique ID) from tID (temp ID, taken from GetPlayerVehicleID)
With this query
pawn Код:
//Called when you press ENTER while chosing the colors of vehicle
new query[1024];
format(query, sizeof(query), "SELECT * FROM car WHERE tID = '%d' LIMIT 1", GetPlayerVehicleID(playerid));
mysql_function_query(connection, query, true, "SetPlate", "dd", playerid, GetPlayerVehicleID(playerid));
pawn Код:
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
//Code here
}
else
{
//ERROR MESSAGE Here
}