int mysql_num_rows(resource $result)
回傳值是int
裡面的resource需要由mysql_query()所執行後的變數
以下是範例code:
$link = mysql_connect("localhost", "user_name", "user_password");$db_select = mysql_select_db("db_name", $link);$sql = "SELECT * FROM table_name";$result = mysql_query($sql, $link);$num_rows = mysql_num_rows($result);
$num_rows的數值就是總筆數
沒有留言:
張貼留言