解析エラー:構文エラー、27行目のview.phpの予期しないT_IF
コードに問題はありません。なぜこれが発生しているのか、助けてください。PHPの初心者です
私のLINE21は>> if(isset($ _ GET ['page'])&& is_numeric($ _ GET ['page']))
if ($result = $mysqli->query("SELECT * FROM players ORDER BY id"))
{
if ($result->num_rows > 0)
{
$total_result = $result->num_rows;
$total_pages = ceil($total_result / $per_page)
if(isset($_GET['page']) && is_numeric($_GET['page']))
{
$show_page = $_GET['page'];
if ($show_page > 0 && $show_page <= $total_pages)
{
$start = ($show_page - 1) * $per_page;
$end = $start + $per_page;
}
else
{
$start = 0;
$end = $per_page;
}
}
else
{
$start = 0;
$end = $per_page;
}
//display paginations
echo "<p> View pages: ";
for ($i=1; $i < $total_pages; $i++)
{
if (isset($_GET['page']) && $_GET['page'] == $i)
{
echo $i . " ";
}
else
{
echo "<a href='view-pag.php?$i'>" . $i . "</a> | ";
}
}
echo "</p>";
}
else
{
echo "No result to display.";
}
}
else
{
echo "Error: " . $mysqli->error;
}