WordPress.org

Ready to get started?Download WordPress

Forums

$wpdb seems to have stopped working (1 post)

  1. hannamyluv
    Member
    Posted 1 year ago #

    I have these lines of code in a custom plugin:

    $table = $table_prefix."posts";
    $sql = "select * from $table where post_status = 'publish' and post_type = 'post'";
    $undone = $wpdb->get_results($sql);

    Up until a few days ago, this piece of code had worked fine. After some testing, I know this is where the code is failing. The entire function just stops working after this line now.

    There were some updates/upgrades done to my server and around this time, this line in the code stopped working. I am not sure if it was the changes to the server or something else.

    The file has not been touched in well over a year and has always worked fine prior to this. I am baffled as to why it stopped working so any suggestions on where to look to fix this would be appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic