Title: Help in Saving in Database
Last modified: August 20, 2016

---

# Help in Saving in Database

 *  Resolved [mashemaru](https://wordpress.org/support/users/mashemaru/)
 * (@mashemaru)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/help-in-saving-in-database/)
 * Just want to know if I have an error in my code, everytime i run my code i get
   an error of `Fatal error: Call to a member function insert() on a non-object 
   in *.php on line 41`
 * here is my code [http://pastebin.com/XnLLsjLd](http://pastebin.com/XnLLsjLd)

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/help-in-saving-in-database/#post-2972762)
 * Include the `global $wpdb;` line inside any function that uses the object.
 *  Thread Starter [mashemaru](https://wordpress.org/support/users/mashemaru/)
 * (@mashemaru)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/help-in-saving-in-database/#post-2972798)
 * Thank you I managed to fix it by adding wp-load.php also. Thanks btw.

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

The topic ‘Help in Saving in Database’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [db](https://wordpress.org/support/topic-tag/db/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [in](https://wordpress.org/support/topic-tag/in/)
 * [save](https://wordpress.org/support/topic-tag/save/)
 * [Saving](https://wordpress.org/support/topic-tag/saving/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [mashemaru](https://wordpress.org/support/users/mashemaru/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/help-in-saving-in-database/#post-2972798)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
