mysql update [rep]
#1

hello all
I am converting my Script to Mysql Newest Version.
my current one is now at r5 and i am converting to r40.
i am stuck in the middle.
plz help me to convert these codes ... so i will get an idea of doing it
i had read tutorial but i couldnot understand
PHP код:
public LoadAirline(airlineid)
{
    new 
query[650];
    
format(querysizeof(query), "SELECT * FROM `airlines` WHERE `ID` = '%d'"airlineid);
    
mysql_query(query);
    
mysql_store_result();
    if(
mysql_num_rows() > 0)
    { 
// airline exists
        
new line[1250];
        if(
mysql_fetch_row(line)) //Fetches the line
          
{
              new 
string2[200];
            new 
data[10][128]; //The data strings
              
new data2[17]; //The data variables
              
new Float:data3[4]; //The data floats
              
sscanf(line"p<|>s[128]s[https://sampforum.blast.hk/showthread.ph...6814]dddds[128]s[128]s[128]s[128]s[128]s[128]dddddffffs[128]s[128]dddddddd"data[0], data[1], data2[0], data2[1], data2[2], data2[3], data[2], data[3], data[4], data[5], data[6], data[7], data2[4], data2[5], data2[6], data2[7], data2[8], data3[0],data3[1],data3[2],data3[3],data[8],data[9],data2[9],data2[10],data2[11],data2[12],data2[13],data2[14],data2[15],data2[16]);
            
format(string2sizeof(string2), "%s"data[0]);
            
strmid(AInfo[airlineid][aName], string20strlen(string2), 128);
            
format(string2sizeof(string2), "%s"data[1]);
            
strmid(AInfo[airlineid][aOwner], string20strlen(string2), 128);
            
AInfo[airlineid][aFlights] = data2[0];
            
AInfo[airlineid][aPayrate] = data2[1];
            
AInfo[airlineid][aBalance] = data2[2];
            
AInfo[airlineid][aID] = data2[3];
            
format(string2sizeof(string2), "%s"data[2]);
            
strmid(AInfo[airlineid][aRank1], string20strlen(string2), 128);
            
format(string2sizeof(string2), "%s"data[3]);
            
strmid(AInfo[airlineid][aRank2], string20strlen(string2), 128);
            
format(string2sizeof(string2), "%s"data[4]);
            
strmid(AInfo[airlineid][aRank3], string20strlen(string2), 128);
            
format(string2sizeof(string2), "%s"data[5]);
            
strmid(AInfo[airlineid][aRank4], string20strlen(string2), 128);
            
format(string2sizeof(string2), "%s"data[6]);
            
strmid(AInfo[airlineid][aRank5], string20strlen(string2), 128);
            
format(string2sizeof(string2), "%s"data[7]);
            
strmid(AInfo[airlineid][aRank6], string20strlen(string2), 128);
            
AInfo[airlineid][aTotalEarnt] = data2[4];
            
AInfo[airlineid][aTotalPaid] = data2[5];
            
AInfo[airlineid][aFleetSlots] = data2[6];
            
//AInfo[airlineid][aFleetTotal] = data2[7]; - We don't need to load it, as it's created upon the airline vehicle spawn.
            
AInfo[airlineid][aUniform] = data2[8];
            
AInfo[airlineid][aPos1] = data3[0];
            
AInfo[airlineid][aPos2] = data3[1];
            
AInfo[airlineid][aPos3] = data3[2];
            
AInfo[airlineid][aPos4] = data3[3];
            
format(string2sizeof(string2), "%s"data[8]);
            
strmid(AInfo[airlineid][aMotd], string20strlen(string2), 200);
            
format(string2sizeof(string2), "%s"data[9]);
            
strmid(AInfo[airlineid][aMotdSetBy], string20strlen(string2), 128);
            
AInfo[airlineid][pInvMembers] = data2[9];
            
AInfo[airlineid][pRmvMembers] = data2[10];
            
AInfo[airlineid][pPrmMembers] = data2[11];
            
AInfo[airlineid][pPrkFleet] = data2[12];
            
AInfo[airlineid][pClrFleet] = data2[13];
            
AInfo[airlineid][pBnkPerm] = data2[14];
            
AInfo[airlineid][pRspFleet] = data2[15];
            
AInfo[airlineid][aDistance] = data2[16];
            if(
AInfo[airlineid][aMapIcon] == 0) { AInfo[airlineid][aMapIcon] = CreateDynamicMapIcon(data3[0], data3[1], data3[2], 50); }
            
mysql_free_result();
        }
        
mysql_free_result();
        
//Admin loaded the airline ID: airlineid
    
}
    else
    {
        
mysql_free_result();
        print(
"Failed to load airline.");
    }

Reply


Messages In This Thread
mysql update [rep] - by bugmenotlol - 02.01.2017, 09:15
Re: mysql update [rep] - by SoLetsGO - 02.01.2017, 10:26
Re: mysql update [rep] - by GoldenLion - 02.01.2017, 13:11
Re: mysql update [rep] - by SoLetsGO - 02.01.2017, 19:15

Forum Jump:


Users browsing this thread: 2 Guest(s)