SA-MP Forums Archive
mysql + php - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: mysql + php (/showthread.php?tid=243693)



mysql + php - iJumbo - 24.03.2011

i have a question..

can i call a function in my gm by using a php webpage using mysql?

example:
i connect to my page and send a query to mysql when query finish activate a callback like
OnQueryFinish and in game send a message that say php query finished success



i can do it? or its just fantasy ?


Re: mysql + php - Calgon - 24.03.2011

Yes, you can do it. You could create a PHP script that enters a query in to your database table (say, tasks) and run a timer in your gamemode to check the 'tasks' table to see if there's any new tasks to complete.


Re: mysql + php - iJumbo - 24.03.2011

mmm can you show me a simple code? please


Re: mysql + php - Calgon - 24.03.2011

http://pastebin.com/uWynNVLi

Untested. But I doubt you'll be able to send more than 1 parameter to a function in PAWN with that.

And the PHP: http://pastebin.com/g9pmYULr (note, to add things you'll need to add things to the $_GET var, so at the end of the URL add '?format=asdasda&parameters=asfafsfah&function=asa ' etc. If you create the table (in MySQL) with the same fields etc, you're going to also need to create 'identifier' as an auto-incrementing field as a primary key.


Re: mysql + php - iJumbo - 24.03.2011

thx im testing