SA-MP Forums Archive
MySql .. More than one database? - 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 .. More than one database? (/showthread.php?tid=434283)



MySql .. More than one database? - iJumbo - 01.05.2013

Hello..

Can i use more than one database connected? (more mysql connections)


Re: MySql .. More than one database? - Scenario - 01.05.2013

Yes, you just need to make sure you're keeping the database connection ID's different.

So, doing dataHandle1 = mysql_connect(...); and dataHandle2 = mysql_connect(...); will connect to two different things.


Re: MySql .. More than one database? - iJumbo - 01.05.2013

So i have to add, to all MySql functions the datahandle variable.. or the frist connection is default 0 so i can add datahandle only for connection 2?


Re: MySql .. More than one database? - Scenario - 01.05.2013

Yes, all functions have to have the connectionHandle variable attached to them. The default is 1, not 0. If you don't want to attach a connectionHandle to all of them, only attach them to the secondary connection; that should work fine!