Saving car information
#10

Okay, I recommend trying the following:
pawn Код:
public SaveCar() // mySQL
{
    MySQLCheckConnection();
    for(new idx = 115; idx < CARINFOMAX; idx++)
    {
        new query[MAX_STRING];
        format(query, MAX_STRING, "UPDATE cars SET ");
        MySQLUpdatePlayerStr2(query, idx, "Model", CarInfo[idx][cModel]);
        MySQLUpdatePlayerFlo2(query, idx, "Locationx", CarInfo[idx][cLocationx]);
        MySQLUpdatePlayerFlo2(query, idx, "Locationy", CarInfo[idx][cLocationy]);
        MySQLUpdatePlayerFlo2(query, idx, "Locationz", CarInfo[idx][cLocationz]);
        MySQLUpdatePlayerFlo2(query, idx, "Angle", CarInfo[idx][cAngle]);
        MySQLUpdatePlayerStr2(query, idx, "ColorOne", CarInfo[idx][cColorOne]);
        MySQLUpdatePlayerStr2(query, idx, "ColorTwo", CarInfo[idx][cColorTwo]);
        //----------------------------------------------------------------------
        MySQLUpdatePlayerStr2(query, idx, "Owner", CarInfo[idx][cOwner]);
        MySQLUpdatePlayerStr2(query, idx, "Description", CarInfo[idx][cDescription]);
        //----------------------------------------------------------------------
        MySQLUpdatePlayerStr2(query, idx, "Value", CarInfo[idx][cValue]);
        MySQLUpdatePlayerStr2(query, idx, "License", CarInfo[idx][cLicense]);
        MySQLUpdatePlayerStr2(query, idx, "Owned", CarInfo[idx][cOwned]);
        //----------------------------------------------------------------------
        MySQLUpdatePlayerStr2(query, idx, "Paintjob", CarInfo[idx][cPaintjob]);
        MySQLUpdatePlayerStr2(query, idx, "mod1", CarInfo[idx][cmod1]);
        MySQLUpdatePlayerStr2(query, idx, "mod2", CarInfo[idx][cmod2]);
        MySQLUpdatePlayerStr2(query, idx, "mod3", CarInfo[idx][cmod3]);
        MySQLUpdatePlayerStr2(query, idx, "mod4", CarInfo[idx][cmod4]);
        MySQLUpdatePlayerStr2(query, idx, "mod5", CarInfo[idx][cmod5]);
        MySQLUpdatePlayerStr2(query, idx, "mod6", CarInfo[idx][cmod6]);
        MySQLUpdatePlayerStr2(query, idx, "mod7", CarInfo[idx][cmod7]);
        MySQLUpdatePlayerStr2(query, idx, "mod8", CarInfo[idx][cmod8]);
        MySQLUpdatePlayerStr2(query, idx, "mod9", CarInfo[idx][cmod9]);
        MySQLUpdatePlayerStr2(query, idx, "mod10", CarInfo[idx][cmod10]);
        MySQLUpdatePlayerStr2(query, idx, "mod11", CarInfo[idx][cmod11]);
        MySQLUpdatePlayerStr2(query, idx, "mod12", CarInfo[idx][cmod12]);
        MySQLUpdatePlayerStr2(query, idx, "mod13", CarInfo[idx][cmod13]);
        MySQLUpdatePlayerStr2(query, idx, "mod14", CarInfo[idx][cmod14]);
        MySQLUpdatePlayerStr2(query, idx, "mod15", CarInfo[idx][cmod15]);
        MySQLUpdatePlayerStr2(query, idx, "mod16", CarInfo[idx][cmod16]);
        MySQLUpdatePlayerStr2(query, idx, "mod17", CarInfo[idx][cmod17]);
        //----------------------------------------------------------------------
        mysql_query(query);
    }
}
Now this won't fully work either, I think the issue here is how you're using it to modify car information. It's originally intended to modify player information, and it's counting on the fact that there is an ID column, and that the ID column is the ID of the player. For this to work, you need an ID column in your car information table, and you need to change the idx variable in the loop to the ID's of the rows in the table with the car information.
Reply


Messages In This Thread
Saving car information - by Typhome - 16.11.2010, 17:38
Re: Saving car information - by JaTochNietDan - 16.11.2010, 18:31
Re: Saving car information - by Grim_ - 16.11.2010, 18:37
Re: Saving car information - by Typhome - 16.11.2010, 18:55
Re: Saving car information - by Grim_ - 16.11.2010, 18:59
Re: Saving car information - by JaTochNietDan - 16.11.2010, 19:00
Re: Saving car information - by Typhome - 16.11.2010, 19:39
Re: Saving car information - by JaTochNietDan - 16.11.2010, 20:40
Re: Saving car information - by Typhome - 16.11.2010, 21:25
Re: Saving car information - by JaTochNietDan - 16.11.2010, 21:50
Re: Saving car information - by Typhome - 17.11.2010, 15:22
Re: Saving car information - by Typhome - 18.11.2010, 22:45
Re: Saving car information - by NewbBeginner - 18.11.2010, 22:46
Re: Saving car information - by Scenario - 18.11.2010, 22:51
Re: Saving car information - by JaTochNietDan - 18.11.2010, 23:23
Re: Saving car information - by Scenario - 19.11.2010, 01:15
Re: Saving car information - by Typhome - 20.11.2010, 20:02
Re: Saving car information - by Typhome - 21.11.2010, 10:21
Re: Saving car information - by NewbBeginner - 21.11.2010, 10:56
Re: Saving car information - by Typhome - 21.11.2010, 12:18

Forum Jump:


Users browsing this thread: 1 Guest(s)