Mysql Help r39-3
#1

My Code:
PHP код:
case THREAD_LOAD_PLAYERTOYS: {
            
mysql_store_result(mysql);
            new
                
szReturn[16],
                
iSlot 0;
            
            while(
mysql_retrieve_row()) {
                
mysql_fetch_field_row(szReturn"ID"mysql);
                
PlayerToyInfo[extraid][iSlot][ptRealID] = strval(szReturn);
                
mysql_fetch_field_row(szReturn"ModelID"mysql);
                
PlayerToyInfo[extraid][iSlot][ptModelID] = strval(szReturn);
                
                
mysql_fetch_field_row(szReturn"Bone"mysql);
                
PlayerToyInfo[extraid][iSlot][ptBone] = strval(szReturn);
                
                if(
PlayerToyInfo[extraid][iSlot][ptBone] > 18 || PlayerToyInfo[extraid][iSlot][ptBone] < 1PlayerToyInfo[extraid][iSlot][ptBone] = 1;
                
                
mysql_fetch_field_row(szReturn"PosX"mysql);
                
PlayerToyInfo[extraid][iSlot][ptPosX] = floatstr(szReturn);
                
                
mysql_fetch_field_row(szReturn"PosY"mysql);
                
PlayerToyInfo[extraid][iSlot][ptPosY] = floatstr(szReturn);
                
                
mysql_fetch_field_row(szReturn"PosZ"mysql);
                
PlayerToyInfo[extraid][iSlot][ptPosZ] = floatstr(szReturn);
                
                
mysql_fetch_field_row(szReturn"RotX"mysql);
                
PlayerToyInfo[extraid][iSlot][ptRotX] = floatstr(szReturn);
                
                
mysql_fetch_field_row(szReturn"RotY"mysql);
                
PlayerToyInfo[extraid][iSlot][ptRotY] = floatstr(szReturn);
                
                
mysql_fetch_field_row(szReturn"RotZ"mysql);
                
PlayerToyInfo[extraid][iSlot][ptRotZ] = floatstr(szReturn);
                
                
mysql_fetch_field_row(szReturn"ScaX"mysql);
                
PlayerToyInfo[extraid][iSlot][ptScaleX] = floatstr(szReturn);
                
mysql_fetch_field_row(szReturn"ScaY"mysql);
                
PlayerToyInfo[extraid][iSlot][ptScaleY] = floatstr(szReturn);
                
mysql_fetch_field_row(szReturn"ScaZ"mysql);
                
PlayerToyInfo[extraid][iSlot][ptScaleZ] = floatstr(szReturn);
                
                
iSlot++;
            }
            
            
mysql_free_result(mysql);
            
            
format(szQuerysizeof(szQuery), "SELECT playervehicles.* FROM playervehicles INNER JOIN players ON playervehicles.Owner = players.ID WHERE players.ID = '%d' ORDER BY playervehicles.Owner ASC LIMIT %d"PlayerInfo[extraid][pID], MAX_PLAYERVEHICLES);
            
mysql_query(szQueryTHREAD_LOAD_PLAYERVEHICLESextraidmysql);
        } 
My Question:
how to change this code into mysql r39-3 from mysql r7 format?

OR

what should be used to replace this "mysql_retrieve_row()" into mysql r39-3?
Reply
#2

mysql_fetch_field_row(szReturn, "ID", mysql);
cache_get_field_content_int(0,"ID",mysql); ---> Same goes for ModelID and the rest of integers.

cache_get_field_content_float(0,"X",mysql);


By the way can I see how you're calling this callback alogn with the query? Also you don't need to store/free result as the cache does it for you.
Reply
#3

But what should I do with this 'mysql_retrieve_rows' as this native does not exist in latest a_MySQL .
Reply
#4

You use cache_get_row_count like so:
PHP код:
for(new iSlotrows cache_get_row_count(); iSlot rowsiSlot++)
{
    
// fetch

Reply
#5

Thanks Vince Its worked for me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)