Help with mysql [r7] - 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: Help with mysql [r7] (
/showthread.php?tid=376723)
Help with mysql [r7] -
CoDeZ - 11.09.2012
Ehm i am having a noob question :/
pawn Код:
forward MySQLConnect();
public MySQLConnect()
{
new DBHandle=mysql_connect(MySQL_Host,MySQL_User,MySQL_DB,MySQL_Password);
if(mysql_ping()==1)
{
mysql_debug(1);
printf("Successfully connected to %s",MySQL_DB);
}
else
{
printf("[MYSQL] Error: Couldn't connect to %s",MySQL_DB);
}
return 1;
}
my connect callback, i added it under ongamemodeinit
Now how to use mysql_function_query?
when i try this
pawn Код:
mysql_function_query(DBHandle,rest of the function);
i get this error
Код:
error 017: undefined symbol "DBHandle"
Re: Help with mysql [r7] -
doreto - 11.09.2012
Quote:
error 017: undefined symbol "DBHandle"
|
DBHandle its like string you must define it before you use it example
- 256 its random change wich yours ,depent how long is
Re: Help with mysql [r7] -
CoDeZ - 11.09.2012
Quote:
Originally Posted by doreto
DBHandle its like string you must define it before you use it example - 256 its random change wich yours ,depent how long is
|
So i define it adding mysql connect function at the top of my script?
Re: Help with mysql [r7] -
Kirollos - 11.09.2012
DBHandle should be integer.
so at the top of the script. write