Need help? Check out our Support site, then


$wpdb get_results is empty

  1. 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:
    <br /> $mydb = new wpdb('user','pass','dbs','localhost');<br /> $rows = $mydb->get_results("SELECT key FROM setting");<br /> print_r($rows);<br />

    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. P.S.
    Ignore the
    tags inside the code.

  3. thistimethisspace
    Member

    That's not a free hosted WordPress.com blog and we can't help you here. If you don't have a username account at WordPress.org click http://wordpress.org/support/ and register one on the top right hand corner of the page that opens, so you can post to the support forums there and receive advice from WordPress.org bloggers.

  4. thistimethisspace
    Member

    P.S. All support for local install of WordPress.ORG software is provided here http://wordpress.org/support/

Topic Closed

This topic has been closed to new replies.

About this Topic