MySQL question
#1

Hello!
I have a question considering MySQL. The query fetches about 30 fields and is called when player connects. I'd like to know whether it is more efficient to use the build in command mysql_fetch_field_row or sscanf2 plugin.

Thanks
Reply
#2

I always use sscanf2, with this plugin: https://sampforum.blast.hk/showthread.php?tid=56564
pawn Код:
format(query, sizeof(query), "SELECT * FROM `data`"); // for example it has 4 fields
    mysql_query(query); // run the query
    mysql_store_result(); // store the results (in query)
    if(mysql_fetch_row_format(query)) // (if it found results)
    {
        sscanf(query, "p<|>s[60]s[24]s[24]s[128]", Data1, Data2, Data3, Data4); // this will store the data in the variables (arrays)
    }
    else
    {
        return 0;
    }
    mysql_free_result();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)