Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Nilesh,

    There’s no “standard” way of getting the row count, but one option is to query a table using SQL and use that value. For instance, to get the number of rows in the wp_options table:

    global $wpdb;
    $query = $wpdb->get_results("SELECT COUNT(*) AS row_count FROM $wpdb->options;");
    $count = $query[0]->row_count;

    You can use the same query for any of the registered tables in the database.

    Thread Starter dodiya nilesh

    (@dodiya-nilesh)

    Thank you

    Dodiya Nilesh

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘number of row’ is closed to new replies.