A problem with sccanf (i think )
#1

Ok so i got this function :
pawn Код:
public LoadPickup(sqlid)
{
    new query[128];
    new wholehouse[256];
    format(query, sizeof(query), "SELECT * FROM `pickups` WHERE `id` = '%d'", sqlid);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(wholehouse);
    printf("pass1");
    sscanf(wholehouse, "p<|>iiifffs[64]",PickupInfo[ploadet][id],PickupInfo[ploadet][modell],PickupInfo[ploadet][tip],PickupInfo[ploadet][Cx],PickupInfo[ploadet][Cy],PickupInfo[ploadet][Cz],PickupInfo[ploadet][texxt]);
    printf("pass2");
    CreatePickup(PickupInfo[ploadet][modell],PickupInfo[ploadet][tip],PickupInfo[ploadet][Cx],PickupInfo[ploadet][Cy],PickupInfo[ploadet][Cz],-1);
    printf("pass3");
    Create3DTextLabel(PickupInfo[ploadet][texxt], 0xFFFF00AA,PickupInfo[ploadet][Cx],PickupInfo[ploadet][Cy],PickupInfo[ploadet][Cz] , 30.0, sqlid, 0);
    ploadet++;
    mysql_free_result();
    printf("pass4");
    return 1;
}
Wich load something frome the DB
I call it like this
pawn Код:
/* Cars /factiones /houses/bizz and much more loadet the same way above,all works corectly*/
    mysql_query("SELECT NULL FROM `pickups`");
    mysql_store_result();
    picktot = mysql_num_rows();
    mysql_free_result();
    printf("There are %d pickups",picktot);
    for(new i = 1; i < picktot+1; i++)
    {
        LoadPickup(i);
    }
    printf("ALL STATIC LOADET FROM MYSQL");
    return 1;
The problem is with the "sscanf" line ,because i get the "pass1" print , but "pass2" or further are not shown.
Here is The DB .
Also , the query returns correct info
Код:
Function: mysql_fetch_row executed with result: "1|1239|23|361.939|173.726|1008.38|/jobs"
Any thots on what's wrong here ?

LE : Solved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)