SA-MP Forums Archive
MYSQL is even possible ? - 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: MYSQL is even possible ? (/showthread.php?tid=636242)



MYSQL is even possible ? - StR_MaRy - 23.06.2017

Hey guys is possible to connect to DB from a FS ?

if yes , how

if now , thx


Re: MYSQL is even possible ? - Eoussama - 23.06.2017

Yes, connect to the DB from OnFilterScriptInIt same as you'll do in a gamemode


Re: MYSQL is even possible ? - StR_MaRy - 23.06.2017

Quote:
Originally Posted by Eoussama
Посмотреть сообщение
Yes, connect to the DB from OnFilterScriptInIt same as you'll do in a gamemode
i get this error

Код HTML:
[17:41:13] [WARNING] CMySQLHandle::Create - connection already exists
shouldn't work if i do it in include ? and use that include where i want to use the DB ?


Re: MYSQL is even possible ? - Vince - 23.06.2017

As far as I'm aware opening multiple connections should work. But you can also "export" the connection handle from the gamemode so you can use the same connection. There are multiple ways to do this. You can use SVars or properties or CallRemoteFunction.


Re: MYSQL is even possible ? - Omirrow - 23.06.2017

Well,

State your MySQL connection in an include,

pawn Код:
new MySQL:yourconnection;
And then state this include on top of both your gamemode and the include you're going to create.

That should probably work. But, I'd create another connection and connect to the same database, if I were you.

It is possible to create multiple connections with BlueG's MySQL Plugin.


Re: MYSQL is even possible ? - StR_MaRy - 23.06.2017

OK, thx all of you all your info's helped me.