嗨,我有以下代码来显示安特里姆郡内的所有高尔夫球场:
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("golf_locate") or die(mysql_error());
$data = mysql_query("SELECT * FROM golf_courses WHERE county = 'Antrim'")
or die(mysql_error());
$image = "golfimage.jpg";
while($info = mysql_fetch_array( $data ))
{
Echo "<div id='image'><img src=".$image.">" . "<br />" . "</div>";
Echo "<div id='text'>";
Echo "Golf Club: " . $info["club_name"] . "<br />";
Echo "County: " . $info["county"] . "<br />";
Echo "To read more information on this golf club and course " . $info["description"];
Echo "</div>";
}
?>
谁能告诉我在它之前可以使用的查询来显示显示的结果数量。例如“在这个县显示 38 个高尔夫俱乐部” - 但结果是使用 php 计算的?
提前致谢 :)