SA-MP Forums Archive
mysql_fetch_field error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql_fetch_field error (/showthread.php?tid=423227)



mysql_fetch_field error - Neil. - 17.03.2013

pawn Код:
stock GetPlayerLinerunnerMissions(playerid)
{
    new val[20];
    new totalvalue;
    format(Query,sizeof(Query),"SELECT `linerunner` FROM `playerinfo` WHERE `user` = '%s'", escpname(playerid));
    mysql_query(Query);
    mysql_store_result();
    mysql_fetch_field("linerunner", val);//argument type mismatch (argument 1)
    totalvalue = strval(val);
    mysql_free_result();
    return totalvalue;
}
See error above


Re: mysql_fetch_field error - mastermax7777 - 17.03.2013

try this ..
pawn Код:
stock GetPlayerLinerunnerMissions(playerid)
{
    new val[20];
    new totalvalue;
    format(Query,sizeof(Query),"SELECT `linerunner` FROM `playerinfo` WHERE `user` = '%s'", escpname(playerid));
    mysql_query(Query);
    mysql_store_result();
    mysql_get_field("linerunner", val);
    totalvalue = strval(val);
    mysql_free_result();
    return totalvalue;
}