Issue loading MySQL stores. -
popben - 11.01.2014
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.
Re: Issue loading MySQL stores. -
Vince - 11.01.2014
You have the connection handle in the wrong place. Destination, delimiter, connection handle, max length.
Re: Issue loading MySQL stores. -
popben - 11.01.2014
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
Re: Issue loading MySQL stores. -
popben - 11.01.2014
hm anyone? trying to solve this but i dont seem to understand.
Re: Issue loading MySQL stores. -
Kaperstone - 11.01.2014
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