How to return mysql result?
#1

Hi, i wan't to get playerbusiness id and then use it. I tryed so:

pawn Код:
public GetPlayerBusiness(playerid, businessid)
{
        if (businessid == INVALID_BUSINESS_ID) return false;
        new query[128];
        format(query,128,"SELECT `id` FROM `"#MYSQL_BUSINESS_TABLE_NAME"` WHERE owner = '%s'",PlayerName(playerid));
        mysql_query(query);
        mysql_store_result();

}
Reply
#2

You may want to look at the mysql tutorials..
Reply
#3

mysql_query("SELECT myid FROM players LIMIT 1");
mysql_store_result();

new myid = mysql_fetch_int();

mysql_free_result();


https://sampwiki.blast.hk/wiki/MySQL#mysql_fetch_int
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)