📜  wp php 从 mysql 获取行数 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:35.382000             🧑  作者: Mango

代码示例1
function get_number_of_db_rows($table_name)
{
    global $wpdb;
    $count_query = "select count(*) from $table_name";
    $num = $wpdb->get_var($count_query);
    return $num;
}