SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Español/Spanish

 
 
Thread Tools Display Modes
Old 09/08/2017, 09:44 PM   #1
Sarti
Little Clucker
 
Sarti's Avatar
 
Join Date: Oct 2016
Posts: 11
Reputation: 0
Default AYUDA MYSQL

Hola estoy actualizando mi gm de mysql r6 a mysql r39-3 me podrian ayudar a convertir este codigo a la version de MySQL r39-3 para tomarlo de base gracias

HTML Code:
format(string, sizeof(string), "SELECT * FROM server WHERE Server = '1'");
	mysql_query (string);
	mysql_store_result();

	if (mysql_num_rows() > 0)
	{
		new wdata[128];
		while (mysql_retrieve_row())
		{
			mysql_get_field("Gamemode",wdata);
			CURRENT_GAMEMODE = strval(wdata);
		}
	}
	else
	{
		printf("[MYSQL]: Could Not Retrieve Field - Shutting Down Server.");
		SendRconCommand("gmx");
	}
	mysql_free_result();
Sarti is offline  
Old 13/08/2017, 07:55 AM   #2
Eloy
Huge Clucker
 
Join Date: May 2016
Location: Venezuela
Posts: 263
Reputation: 4
Default Respuesta: AYUDA MYSQL

PHP Code:
new MySQLHandler;

mysql_tquery(Handler"SELECT * FROM server WHERE Server = '1'",  "LoadData");

forward LoadData();
public 
LoadData()
{
    new 
Resultado cache_num_rows();
    new 
DataLoadeddata[128];
    if(
Resultado 0)
    {
        while(
DataLoaded Resultado)
        {
            
/* Un pequeño ejemplo... */
            /* ROW 1 */
cache_get_value_name(DataLoaded"Gamemode"data);
            
CURRENT_GAMEMODE strval(data);

        }
    }
    else
    {
        
printf("[MYSQL]: Could Not Retrieve Field - Shutting Down Server.");
        
SendRconCommand("gmx");
    }
    return 
1;

Eloy is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 01:17 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.