Loading only one vehicle from the database.
#4

Quote:
Originally Posted by danielpalade
Посмотреть сообщение
And how exactly do I do that?
I've tried with "for(new i" etc.. But it didn't work.. :c
Simply because your code is wrong, you are expecting a vehicleid parameter when loading, which shouldn't be there
PHP код:
public OnCarsLoad()
{
    for(new 
i,j=cache_num_rows();i<j;i++)
    {
    new 
tmp[256], string5[256];
    
cInfo[i][cModel] = cache_get_field_content_int(i"carModel");
    }

Here's an example, fix your code according to this

Oh, and I'm assuming you don't use this OnCarsLoad again, if you are you should assign a global var, and increment it everytime you create a car, and load your array according to that global variable.
Reply


Messages In This Thread
Loading only one vehicle from the database. - by danielpalade - 16.01.2016, 12:44
Re: Loading only one vehicle from the database. - by Vince - 16.01.2016, 13:10
Re: Loading only one vehicle from the database. - by danielpalade - 16.01.2016, 13:17
Re: Loading only one vehicle from the database. - by PrO.GameR - 16.01.2016, 13:55
Re: Loading only one vehicle from the database. - by PatrickGTR - 16.01.2016, 14:17
Re: Loading only one vehicle from the database. - by danielpalade - 16.01.2016, 14:51

Forum Jump:


Users browsing this thread: 1 Guest(s)