Add ajax object to project
Add event Ajax post and give tag name (tag ie posttoserver)
Adress needs to be your php file (ie yourserver/yourfile.php, paramters added like "request=getdata&somekey=somevar")
Catch $_POST[variable] (if($_POST[request]=="getdata")) with a request for data on the php end
Have php on your server process mysql query based on post request
echo mysl data in your php file
This data is relayed back to your game/application
Use event on request complete (tag ie posttoserver)
This even and subs hold the variable AJAX.Lastdata, which is the information you have echoed in your php file.
Do something with data :)