有個(gè)Mysql數(shù)據(jù)庫(kù)問題不懂,就是為什么不用mysql_num_rows()???
$total_result=mysql_fetch_array(mysql_query($total_sql));
$total=$total_result[0];這個(gè)是什么意思??
$total_result=mysql_fetch_array(mysql_query($total_sql));
$total=$total_result[0];這個(gè)是什么意思??
舉報(bào)
2016-10-27
mysql_num_rows()是獲取結(jié)果集中行的數(shù)目,$total_result=mysql_fetch_array(mysql_query($total_sql));?mysql_fetch_array是函數(shù)從結(jié)果集中取得一行作為關(guān)聯(lián)數(shù)組,或數(shù)字?jǐn)?shù)組,或二者兼有,$total=$total_result[0];是獲取結(jié)果集的第一行并把結(jié)果返回給$total