Title: Write data on another Database
Last modified: August 19, 2016

---

# Write data on another Database

 *  [_OMEGA_](https://wordpress.org/support/users/_omega_/)
 * (@_omega_)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/write-data-on-another-database/)
 * Hi all, I have a little problem.
    I need to write data on another Database, not
   the standard WP one, just to do not make dull the standard Database. I’ve written
   all the code and everything works good (I can create a table and write in it,
   but it’s unfortunatelly in the standard WP database), but when I try to modify
   my source to tell to my plugin to write in another database and when I try to
   use this code:
 *     ```
       $wpdb_otherdb->query( $wpdb_otherdb->prepare( "
       	INSERT INTO MyTable
       	( id, id_name, id_title )
       	VALUES ( %d, %s, %s )",
               'NULL', $id_name, $id_title ) );
       ```
   
 * I have this error:
 * > Fatal error: Call to a member function query() on a non-object
 * Anyone can help me about this?

Viewing 1 replies (of 1 total)

 *  [hexa6on](https://wordpress.org/support/users/hexa6on/)
 * (@hexa6on)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/write-data-on-another-database/#post-1327247)
 * I have the same problem. 🙁
 * Been looking for hours for a solution. Have you found one, by chance?

Viewing 1 replies (of 1 total)

The topic ‘Write data on another Database’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [hexa6on](https://wordpress.org/support/users/hexa6on/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/write-data-on-another-database/#post-1327247)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
