Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$query = "SELECT * FROM XXXX"; $result = mysql_query($query); $noOfRows = mysql_num_rows($result);
$resultの結果を取得する前に空かどうかを確認する方法はmysql_num_rows?
$result
mysql_num_rows
$result三項演算子で を確認し、次の場合に設定$noOfRowsできます。0false
$noOfRows
0
false
$query = "SELECT * FROM XXXX"; $result = mysql_query($query); $noOfRows = (false===$result)? 0 : mysql_num_rows($result);