public function getRecordNum($table = null) { $table = $table ?: $this->tableName; $sql = "SELECT * FROM {$table} WHERE 1"; return $this->query($sql)->num_rows; }