Issue loading MySQL stores.
#1

Hello everyone,

I'm currently stumped on this. I have been studying online to try and fix this but i have to resort to the SA-MP forums.

I will be grateful for your help

Here is the code that loads the houses into the server but is failing.


pawn Код:
AddStoresFromMysql()
{
    new Str[1000], id, Float:X, Float:Y, Float:Z, STotal;
  //  mysql_tquery("SELECT * FROM `stores`");
    mysql_query(g_pSQL, "SELECT * FROM `stores`");
    mysql_store_result();


        while(mysql_fetch_row(g_pSQL, Str, "|"))
            {
            if(!mysql_num_rows()) continue;
                sscanf(Str, "p<|>ifff",id, X, Y, Z);
                print(Str);
                CreateDynamicPickup(1274, 23, X, Y, Z, -1, -1, -1, PICKUPDISTANCE);
                pickupdata[id][Type]=1;
                CreateDynamic3DTextLabel("Store", -1, X, Y, Z, 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, TEXTLABELDISTANCE);
                CreateDynamicMapIcon(X, Y, Z, 38, 0, -1, -1, -1, MAPICONDISTANCE);
                printf("Store spawned at %f %f %f!",X,Y,Z);
                STotal++;
        }
    mysql_free_result();
    printf("** %i\t<->\tStores Loaded From\t<->\tMySQL\t\t   **", STotal);

    return 1;
}



The problem is
Код:
 while(mysql_fetch_row(g_pSQL, Str, "|"))
I'm using MySQL r34 (linux) the error i get when compling this is as per followed,


Код:
CNR.pwn(5706) : error 035: argument type mismatch (argument 1)
Thank you if you need anymore info please reply.
Reply
#2

You have the connection handle in the wrong place. Destination, delimiter, connection handle, max length.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
You have the connection handle in the wrong place. Destination, delimiter, connection handle, max length.
Could you please show me a example?

Sorry im still learning MySQL
Reply
#4

hm anyone? trying to solve this but i dont seem to understand.
Reply
#5

pawn Код:
while(mysql_fetch_row_format(Str, "|",g_pSQL))
Function syntax :
mysql_fetch_row_format(string[], const delimiter[], connectionHandle);
https://sampwiki.blast.hk/wiki/MySQL#mysql_fetch_row_format
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)