#1

hello how do I put this mysql r5 to r7

I just need help do not get out: (
I see once how this piece I need to rest myself

mysql_query to mysql_function_query




Код:
format(string, sizeof(string), "SELECT * FROM server WHERE Server = '1'");
	mysql_query(string);//Queries
    mysql_store_result(); //Stores the result

	if(mysql_num_rows() > 0) 
    {
		new wdata[128];

		while(mysql_retrieve_row())
		{
		mysql_get_field("Gamemode",wdata);
		CURRENT_GAMEMODE = strval(wdata);
		}
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=337810

Assuming there's only 1 rows, otherwise your code above would fail because CURRENT_GAMEMODE would hold only the value of the last row:
pawn Код:
// connection handle is the variable you've stored the connection ID:
// MySQL = mysql_connect(...);
mysql_function_query(/* Connection Handle HERE*/, "SELECT * FROM server WHERE Server = 1", true, "OnServerLoad", "");

forward OnServerLoad();
public OnServerLoad()
{
    new rows;
    cache_get_data(rows, _);
    if (rows)
    {
        new wdata[128];
        cache_get_field_content(0, "Gamemode", wdata);
        CURRENT_GAMEMODE = strval(wdata);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)