MYSQL Select question
#1

Hello,

How can I change this code:

pawn Код:
stock InitVehicles()
{
    new query[400];
    for(new id; id < MAX_SERVERVEHICLES; id++) // Goes through all the slots, looking for the data
    {
        format(query, sizeof(query), "SELECT * FROM `Vehicles` WHERE `VehicleID` = %d", id); // Selects all the information from the table
        mysql_function_query(g_connectionHandle, query, true, "LoadVehiclesCallback", "d", id);
    }
    return 1;
}
So it can load all the data from that Vehicles table, and continue to load the cars, because if:

I have these cars:

1,2,3,4,5,6,7,8,9,10

And I delete car 5, then the script still checks car 5 and the Auto_Increment value would never set slot 5 again so it would make 11 instead.

so if I set my MAX_SERVERVEHICLES to 1000 and I deleted 1000 cars and save another 1000 then it does not spawn anything anymore.. (atleast thats my logic..)
Reply


Messages In This Thread
MYSQL Select question - by Stefand - 28.01.2014, 15:39

Forum Jump:


Users browsing this thread: 1 Guest(s)