Title: $wpdb and $num_rows
Last modified: August 21, 2016

---

# $wpdb and $num_rows

 *  Resolved [davdee](https://wordpress.org/support/users/davdee/)
 * (@davdee)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/wpdb-and-num_rows/)
 * Just wondering if I am using this variable incorrectly?
 * After a wpdb call, I use it to get the number of rows returned, etc
 * << echo ‘Value of rows is: ‘ . $num_rows ; >>
 * But always nothing comes back; am I using it right?
    Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [davdee](https://wordpress.org/support/users/davdee/)
 * (@davdee)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/wpdb-and-num_rows/#post-5019839)
 * Solved I think. You must do a sql call (using $wpdb->num_rows) to get a value.

Viewing 1 replies (of 1 total)

The topic ‘$wpdb and $num_rows’ is closed to new replies.

## Tags

 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 1 reply
 * 1 participant
 * Last reply from: [davdee](https://wordpress.org/support/users/davdee/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/wpdb-and-num_rows/#post-5019839)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
