-3
나는 PHP에 익숙하지 않다. wp 플러그인을 사용하는 동안 다음 오류가 발생합니다. mysql_num_rows()는 매개 변수 1이 리소스, C : \ xampp \ htdocs ... \ wp-content \ plugins ...... \ admin \ wpbooking_admin.php on line 7619mysql_num_rows()는 매개 변수 1이 리소스가 될 것으로 예상하고, 부울은 7619에 주어진다.
코드 입니다.
function wpbooking_country() {
global $wpdb;
global $wpbooking_options;
include(WPBOOKING_PLUGIN_DIR.'/includes/pagination.class.php');
$id = @$_GET['idt'];
if ($id) {
$where = " WHERE id = ".$id."";
} else {
$where = "";
}
$table_name = $wpdb->prefix . "booking_country";
$items = mysql_num_rows(mysql_query("SELECT * FROM ". $table_name ." ".$where."")); // number of total rows in the database
if($items > 0) {
$p = new pagination;
$p->items($items);
$p->limit(30); // Limit entries per page
$p->target("admin.php?page=booking_country");
$p->currentPage(isset($_GET['paging'])); // Gets and validates the current page
$p->calculate(); // Calculates what to show
$p->parameterName('paging');
$p->adjacents(1); //No. of page away from the current page
if(!isset($_GET['paging'])) {
$p->page = 1;
} else {
$p->page = $_GET['paging'];
}
죄송합니다. –
같은 오류를 반환합니다. 그러나'var_dump ($ res)'의 출력은 무엇입니까? false이면 오류를 표시하고 mysql에서 직접 실행하여 오류를 확인해야합니다. – vaso123