Title: wordpress and database
Last modified: August 20, 2016

---

# wordpress and database

 *  Resolved [cerberus478](https://wordpress.org/support/users/cerberus478/)
 * (@cerberus478)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/wordpress-and-database/)
 * I would like to know if there is a way for wordpress to retrieve certain information
   from a database.
 * In my database i have tables called flowers, address.
 * For example in my flowers table I have a couple of rows that have images and 
   descriptions of flowers and I want wordpress to retrieve all the information 
   from that table and display it onto the site.
 * I hope I made some sense.

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/wordpress-and-database/#post-3205894)
 * Try something like:
 *     ```
       <?php $result = $wpdb->get_results( $wpdb->prepare(
         "SELECT * FROM flowers ORDER BY name",
         $pattern) );
       ?>
       ```
   
 *  [mr_zhang](https://wordpress.org/support/users/mr_zhang/)
 * (@mr_zhang)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/wordpress-and-database/#post-3205931)
 * As long as it’s in the same database, you can use the global $wpdb, just like
   esmi said. Here’s the link from wordpress:
    [http://codex.wordpress.org/Class_Reference/wpdb](http://codex.wordpress.org/Class_Reference/wpdb)

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

The topic ‘wordpress and database’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 3 participants
 * Last reply from: [mr_zhang](https://wordpress.org/support/users/mr_zhang/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/wordpress-and-database/#post-3205931)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
