WordPress.org

Ready to get started?Download WordPress

Forums

$wpdb get_results is empty (3 posts)

  1. devboy
    Member
    Posted 1 year ago #

    Hello.
    I use two websites with their own databases on my server. One is wordpress personal website and other is opencart web shop. What i would like to do is fetch some of the data from opencart database and display it on my wordpress page.

    My code inside wordpress file:

    $mydb = new wpdb('user','pass','dbs','localhost');
    $rows = $mydb->get_results("SELECT key FROM setting");
    print_r($rows);

    What I get is an empty array, although the column exist and it is filled with content.

    Whats funny is that it works with some column names inside the same table. But not with the column i want.

    Thank you

  2. devboy
    Member
    Posted 1 year ago #

    Anyone?

  3. gafa
    Member
    Posted 9 months ago #

Topic Closed

This topic has been closed to new replies.

About this Topic