Counting Rows Returned
-
How would I count rows returned if I want to use a SELECT query. I have no idea how to run queries using wordpress’s functions and what I want to do it see if there are zero rows returned. so what would this translate to if I wanted to use wordpress functions.
<?php
$myvar = mysql_query(“SELECT * FROM wp_visitorip WHERE ip=’$user_ip'”);
$myvar = mysql_num_rows($myvar);
if($myvar = 0) {
// no rows
} else {
// at least 1 row
}
?>Max
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Counting Rows Returned’ is closed to new replies.