Mysql Error
#1

Код:
QUERY = INSERT INTO `cars` bla bla ---------------
Код:
forward InsertBuyCar(playerid);
public InsertBuyCar(playerid)
{
    new dest2[128],dest[128];
     new testcar = CreateVehicle(422,-10,-10,-10,0,0,0,-1);
    new vehicleid = testcar;
    DestroyVehicle(testcar);
   	
    new i = cache_insert_id();
   	
    CarsInfo[vehicleid][vID] = cache_get_field_content_int(i, "ID");
    cache_get_field_content(i, "Owner",dest);
    format(CarsInfo[vehicleid][vOwner], 128,dest);
    CarsInfo[vehicleid][vModel] = cache_get_field_content_int(i, "Model");
    CarsInfo[vehicleid][vSpawnX] = cache_get_field_content_float(i, "SpawnX");
    CarsInfo[vehicleid][vSpawnY] = cache_get_field_content_float(i, "SpawnY");
    CarsInfo[vehicleid][vSpawnZ] = cache_get_field_content_float(i, "SpawnZ");
    CarsInfo[vehicleid][vSpawnA] = cache_get_field_content_float(i, "SpawnA");
    CarsInfo[vehicleid][vColor1] = cache_get_field_content_int(i, "Color1");
    CarsInfo[vehicleid][vColor2] = cache_get_field_content_int(i, "Color2");
    .........................................................................
    CarsInfo[vehicleid][vFuel] = cache_get_field_content_int(i, "Fuel");
    CarsInfo[vehicleid][vHealth] = cache_get_field_content_int(i, "Health");
Error:

Код:
In callback "InsertBuyCar"
02:46:11	cache_insert_id	OK	connection: 1
02:46:11	cache_get_field_content_int	OK	row: 0, field_name: "ID", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content	OK	row: 0, field_name: "Owner", connection: 1, max_len: 128
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content_int	OK	row: 0, field_name: "Model", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content_float	OK	row: 0, field_name: "SpawnX", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content_float	OK	row: 0, field_name: "SpawnY", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content_float	OK	row: 0, field_name: "SpawnZ", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content_float	OK	row: 0, field_name: "SpawnA", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content_int	OK	row: 0, field_name: "Color1", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
02:46:11	cache_get_field_content_int	OK	row: 0, field_name: "Color2", connection: 1
...............................................................................................
02:46:11	cache_get_field_content_int	OK	row: 0, field_name: "Fuel", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	cache_get_field_content_int	OK	row: 0, field_name: "Health", connection: 1
02:46:11	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('1')
02:46:11	CMySQLResult::~CMySQLResult()	OK	deconstructor called
I can't figure it out alone, what's the problem? Row creates succesfully, but it don't load's, what can I do?
Reply
#2

Are you using the latest version of MySQL?
Reply
#3

MYSQL R33
Reply
#4

Executing an INSERT query will allow you to retrieve the value generated by auto increment but it will NOT select the data for you to retrieve them at the same callback. Honestly, you don't even need to do that - assign the data to the variables at the same place you call the query.
Reply
#5

Why don't you use R41??
Reply
#6

i almost forget about this thred, thank you for the support, i figure it out alone
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)