Mysql to Sqlite
#1

Hey Guys and Girls,


I would like to convert a mysql code into sqlite code but I don't know how to achieve this with the following code

Код:
loadGangZone( gzid )
{
    new query[256];
    format(query, sizeof(query),"SELECT * FROM `gangzoneinfo` WHERE id=%d",gzid);
    db_query(GangZonesDB, query);
    // mysql_store_result();

    if( mysql_num_rows() )
    {
        if(mysql_fetch_row(query,"|"))
        {
            printf("[GangZone] A gz [id%d] estб sendo carregada..." , gzid );
            new field[7][25];
            explode(query, field, "|");
            // mysql_free_result();
			db_free_result(query);
            gangzoneInfo[gzid][gzId]    = GangZoneCreate( floatstr(field[2]) , floatstr(field[3]) , floatstr(field[4]) , floatstr(field[5]) );
            gangzoneInfo[gzid][gzName]  = field[1];
            gangzoneInfo[gzid][gzMinX]  = floatstr( field[2] );
            gangzoneInfo[gzid][gzMinY]  = floatstr( field[3] );
            gangzoneInfo[gzid][gzMaxX]  = floatstr( field[4] );
            gangzoneInfo[gzid][gzMaxY]  = floatstr( field[5] );
            gangzoneInfo[gzid][gzOwner]  = strval( field[6] );

            printf("[GangZone] A gz [id%d] foi carregada com os seguintes dados:" , gzid );
            printf("[] ID: %d|Nome: %s|Owner: %d" , gangzoneInfo[gzid][gzId] , gangzoneInfo[gzid][gzName] , gangzoneInfo[gzid][gzOwner] );
            printf("[] MinX: %f|MinY: %f|MaxX: %f|MaxY: %f|" , gangzoneInfo[gzid][gzMinX] , gangzoneInfo[gzid][gzMinY] , gangzoneInfo[gzid][gzMaxX] , gangzoneInfo[gzid][gzMaxY] );
            printf("[GangZone] A gz [id%d] foi carregada por inteiro." , gzid );
        }
   }
}
I know I can turn mysql_num_rows into db_num_rows
mysql_free_result into db_free_result

But I don't know how to handle the following codes:

Код:
mysql_store_result
and this one

Код:
 if(mysql_fetch_row(query,"|"))
Is there a way to do it?


Kind regards,
Mike
Reply


Messages In This Thread
Mysql to Sqlite - by mrxqware - 19.06.2014, 22:17
Re: Mysql to Sqlite - by [WSF]ThA_Devil - 19.06.2014, 22:20
Re: Mysql to Sqlite - by mrxqware - 21.06.2014, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)