I'm trying to connect a MySQL database via PHP to an iPhone app. I'm following this tutorial http://codewithchris.com/iphone-app-connect-to-mysql-database/
This is my first time doing anything like this, so I'm sorry if I'm leaving out some key information.
Here's the php file that I uploaded to the database on Bluehost
<?php
// Create connection
$con=mysqli_connect("localhost","gaethrco_travis","Energy=mc^2","gaethrco_data");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// This SQL statement selects ALL from the table 'Locations'
$sql = "SELECT * FROM Locations";
// Check if there are results
if ($result = mysqli_query($con, $sql))
{
// If so, then create a results array and a temporary one
// to hold the data
$resultArray = array();
$tempArray = array();
// Loop through each row in the result set
while($row = $result->fetch_object())
{
// Add each row into our results array
$tempArray = $row;
array_push($resultArray, $tempArray);
}
// Finally, encode the array to JSON and output the results
echo json_encode($resultArray);
}
// Close connections
mysqli_close($con);
?>
Here's the plist in Xcode
Here's Bluehost
My problem is that when I go to my website gaethr.com/service.php nothing happens. According to the tutorial, this should happen
Let me know if I'm leaving out some key information.