WordPress.org

Support

Support » Plugins and Hacks » Hacks » [Resolved] Fatal error: Unsupported operand types – using $wpdb

[Resolved] Fatal error: Unsupported operand types – using $wpdb

  • 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 ?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Fatal error: Unsupported operand types – using $wpdb’ is closed to new replies.