Retrieve multiple rows from database
#3

Quote:
Originally Posted by FaLLenGirL
Посмотреть сообщение
That.. i will never do something like this when i'll want to load something, but that's the way i will do it, that's the way i already do so here is:

PHP код:
forward LoadHousesCb( );
public 
LoadHousesCb( )
{
    new 
rows;
    
cache_get_row_countrows );
    if( 
rows )
    {
        new 
idhouses;
        while( 
houses rows )
        {
            
cache_get_value_inthouses"ID"id );
            
Houseid ][ HouseID ] = id;
            
cache_get_value_namehouses"HouseOwner"Houseid ][ HouseOwner ], .max_len 48 );
            
cache_get_value_inthouses"HousePrice"Houseid ][ HousePrice ] );
            
cache_get_value_inthouses"HouseInterior"Houseid ][ HouseInterior ] );
            
cache_get_value_inthouses"isLocked"Houseid ][ isLocked ] );
            
cache_get_value_inthouses"HouseLevel"Houseid ][ HouseLevel ] );
            
cache_get_value_inthouses"HouseStatus"Houseid ][ HouseStatus ] );
            
cache_get_value_floathouses"HouseEntranceX"Houseid ][ HouseEntranceX ] );
            
cache_get_value_floathouses"HouseEntranceY"Houseid ][ HouseEntranceY ] );
            
cache_get_value_floathouses"HouseEntranceZ"Houseid ][ HouseEntranceZ ] );
            
houses ++;
        }
        
printf"Loaded %d houses."houses );
    }
    return 
1;

This worked but it is skipping HouseID 1, idk why.
Reply


Messages In This Thread
Retrieve multiple rows from database - by JaskaranSingh - 02.03.2018, 18:29
Re: Retrieve multiple rows from database - by FaLLenGirL - 02.03.2018, 18:43
Re: Retrieve multiple rows from database - by JaskaranSingh - 03.03.2018, 18:40
Re: Retrieve multiple rows from database - by JaskaranSingh - 03.03.2018, 18:50
Re: Retrieve multiple rows from database - by Grim_ - 03.03.2018, 21:08
Re: Retrieve multiple rows from database - by eSPeZet - 03.03.2018, 21:18

Forum Jump:


Users browsing this thread: 1 Guest(s)