I'm writing a custome plugin with custome database, but using the $wpdb class. For pagination I am trying to return a count from the database then perform a calculation on the results, but there is a problem with my code, which is causing this error:
Fatal error: Unsupported operand types in ... on line 53
here is the code:
$pages_query = $wpdb->prepare("SELECT COUNT FROM Table WHERE FullName LIKE '%%%s%%';", $NameSearch . '%'); $pages = ceil($wpdb->get_results($pages_query, 0) / $per_page);
How can I fix this ?