PHP를 통해 MySQL 데이터베이스를 iPhone 앱에 연결하려고합니다. 나는이 튜토리얼을 따라 가고있다. http://codewithchris.com/iphone-app-connect-to-mysql-database/내 PHP 파일이 반환하지 않는 이유는 무엇입니까?
이것은 내가 처음으로 이런 식으로 일하는 것이므로, 몇 가지 주요 정보를 남겨두면 유감 스럽다. 여기
여기 여기내 문제 Bluehost를
의엑스 코드에서 PLIST이야 내가 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);
?>
의 데이터베이스에 업로드 PHP 파일입니다 ~이다. 내가 내 웹 사이트 gaethr.com/service.php 에 갈 때 아무 일도 일어나지 않습니다. 튜토리얼에 따르면,이
내가 몇 가지 중요한 정보를 떠날거야 알려줘 발생한다.
이 질문에 아이폰 OS, 스위프트 3, 엑스 코드 8과 아무 상관을 검증 베타 2. 나는 그 태그를 제거합니다. – Alexander
쿼리가 성공했는지 확인해야합니다. 연결 상태는 양호하지만 쿼리가 실패했을 수 있습니다 (예 :'Locations' 테이블이 존재하지 않습니다) : if ($ result = mysqli_query ($ con, $ sql)) {...} else {echo mysqli_error ($ con); }'* 또는 something * – HPierce