これは空白のページを返します:
<?php
$con=mysqli_connect("xxx.x.xx.x","user","password","db");
// check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT column FROM table WHERE id=1");
print $result;
mysqli_close($con);
?>
そして、これはデータを返します:
<?php
$con=mysqli_connect("xxx.x.xx.x","user","password","db");
// check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM table");
while($row = mysqli_fetch_array($result))
{
echo $row['column_1'] . " " . $row['column_2'];
echo "<br>";
}
mysqli_close($con);
?>
データを返さないコードの最初のブロックの何が問題になっていますか?