Title: Access to WordPress 3 database
Last modified: August 20, 2016

---

# Access to WordPress 3 database

 *  [bjarneh](https://wordpress.org/support/users/bjarneh/)
 * (@bjarneh)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/access-to-wordpress-3-database/)
 * In Joomla an access to database could be:
    function getSats() { $db = JFactory::
   getDBO(); $sql = “SELECT * FROM jos_alphajob_sats”; $db->setQuery($sql); $data
   = $db->loadObjectList(); return($data); } How is the code in WordPress?
 * Yours
    Bjarne

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/access-to-wordpress-3-database/#post-2293311)
 * [http://codex.wordpress.org/Class_Reference/wpdb](http://codex.wordpress.org/Class_Reference/wpdb)
 *  Thread Starter [bjarneh](https://wordpress.org/support/users/bjarneh/)
 * (@bjarneh)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/access-to-wordpress-3-database/#post-2293603)
 * This code gives not the right result:
 * global $wpdb;
    $myrows = $wpdb->get_results( “SELECT * FROM alphajob_sats” );
 * I have a table (alphajob_sats) with 2 fields and 5 records, and I want $myrows
   = this data, but how?
 * Please help!
 *  Thread Starter [bjarneh](https://wordpress.org/support/users/bjarneh/)
 * (@bjarneh)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/access-to-wordpress-3-database/#post-2293689)
 * I have a table (alphajob_sats) with 2 fields(columns) and 5 records(rows), and
   I want $myrows = this data, but how?
 * In Joomla an access to database could be:
    function getSats() { $db = JFactory::
   getDBO(); $sql = “SELECT * FROM jos_alphajob_sats”; $db->setQuery($sql); $data
   = $db->loadObjectList(); return($data); } How is the code in WordPress?
 * This code are not giving the right result:
 * global $wpdb;
    $myrows = $wpdb->get_results( “SELECT * FROM alphajob_sats” );
 * Please help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Access to WordPress 3 database’ is closed to new replies.

## Tags

 * [database access](https://wordpress.org/support/topic-tag/database-access/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [bjarneh](https://wordpress.org/support/users/bjarneh/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/access-to-wordpress-3-database/#post-2293689)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
