私のテーブルには10個のレコードがあり、mysql_num_rowsはmysqlリソースに10行あると言っています。phpMyAdminでは10行を見ることができますが、mysql_fetch_arrayが呼び出されると、最初の2回は正しく機能し、最後の8回はFALSEを返します。
なんで?
$query = "SELECT * FROM building_types";
$building_types = mysql_query($query) or die( mysql_error() );// works
echo mysql_num_rows($building_types); // prints 10
$num_rows = mysql_num_rows($building_types);
for ( $i = 0 ; $i < $num_rows ;$i++ )
{
echo"hi1"; // this is printed 10 times
$building_type = mysql_fetch_array($building_types);
echo $building_type; // prints Array 2 times not 10 times ...
if ( $building_type === FALSE ) echo"hi2"; //this is printed the last 8 times ...
ありがとう、