SQL databse
#1

i have an SQL databse , which is created in my gamemode..

but i want to access the values from inside it in another filterscript.. how do i achieve this ?
Reply
#2

You mean you want to connect to the database within a filterscript?
Reply
#3

yes exactly
Reply
#4

Well just copy the part in your gamemode that connects to the database, mostly this will be in OnGameModeinit.
And you have to include the mysql.inc in your filterscript, also you can copy this from your gamemode.
Reply
#5

Use:
pawn Код:
db_open( name[ ] ); // At OnFilterScriptInit
db_close( DB:Database ); // At OnFilterScriptExit
And do your job )

-----------


Quote:
Originally Posted by Roel
Посмотреть сообщение
Well just copy the part in your gamemode that connects to the database, mostly this will be in OnGameModeinit.
And you have to include the mysql.inc in your filterscript, also you can copy this from your gamemode.
Lol man, it's not MYSQL, it's SQLite lol...
Reply
#6

congratz
Reply
#7

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Use:
pawn Код:
db_open( name[ ] ); // At OnFilterScriptInit
db_close( DB:Database ); // At OnFilterScriptExit
And do your job )
are u sure that works ? my server crashes when i reach the function where the FS is extracting from the database

also is this a legit query ??

pawn Код:
format(Query, sizeof(Query), "SELECT * FROM `USERS` WHERE `NAME` = '%s' ", DB_Escape(name));
Reply
#8

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)