How can I connect android uploads PHP data with MySQL database?

view story

http://stackoverflow.com – I created an android application for uploads data to my webserver into PHP file and output data to .txt file. I upgraded my server and now I support databases. How can I convert/update the below php code toconnect with a MySQL database? In android side use HTTP POST to url mysite/location.php I want add records latitude,longitude to my database...mysql query...need code example... <?php $lat = $_POST["lat"]; // Declares the upload data from client as a variable $lon = $_POST["lon"]; $textfile = "location.txt"; // Declares the name and location of the .txt file $fileLocation = "$textfile (HowTos)