help mysql
#1

C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(5487) : error 017: undefined symbol "mysql_store_result"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(548 : error 017: undefined symbol "mysql_num_rows"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(5496) : error 017: undefined symbol "mysql_free_result"

Code:
	new qstr[100];
	format(qstr,100,"SELECT * FROM `players` WHERE `username`='%s';",plname);
	mysql_query (qstr);
	mysql_store_result();
	if(mysql_num_rows() != 0)
	{
		gPlayerAccount[playerid] = 1;
	}
	else
	{
		gPlayerAccount[playerid] = 0;
	}
	mysql_free_result();
	return 1;
}
use mysql r39-3
Reply
#2

upppp
Reply
#3

Quote:
Originally Posted by Jimmi
View Post
upppp
define it?
Reply
#4

Hello!

PHP Code:
new qstr[100];
mysql_format(handle,qstr,sizeof qstr,"SELECT * FROM `players` WHERE `username`='%e';",plname);
mysql_tquery(handle,qstr,"OnLoadPlayer","i",playerid);//handle is the connection handle, please adjust this
//at the end of the script:
forward OnLoadPlayer(playerid);
public 
OnLoadPlayer(playerid)
{
    if(!
cache_num_rows())return 1;
    
gPlayerAccount[playerid] = 1;
    return 
1;

Notice:
Quote:

//handle is the connection handle, please adjust this

- Mencent
Reply
#5

Quote:
Originally Posted by Mencent
View Post
Hello!

PHP Code:
new qstr[100];
format(qstr,sizeof qstr,"SELECT * FROM `players` WHERE `username`='%s';",plname);
mysql_tquery(handle,qstr,"OnLoadPlayer","i",playerid);//handle is the connection handle, please adjust this
//at the end of the script:
forward OnLoadPlayer(playerid);
public 
OnLoadPlayer(playerid)
{
    if(!
cache_num_rows())return 1;
    
gPlayerAccount[playerid] = 1;
    return 
1;

Notice:


- Mencent
Use this, but replace Username='%s' with Username='%e' and replace format with mysql_format(handle, qstr
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)