views:

17

answers:

0

Hi,

I am creating a plugin for wordpress3.0.1.I have created two tables wp_subscription_options & wp_user_plans while activate the plugin. I have created admin user interface using html to save plugin setting into wp_subscription_options table. i have created two php files 1.menu.php & addoptions.php under wp plugin directory. I want to post the form to addoption.php to store values in wp_subscription_options table. using this query :

global $wpdb; $result = $wpdb->query( $wpdb->prepare( " INSERT INTO $table_name ( name, season, copyright, description, path ) VALUES ( %s, %s, %s, %s, %s )", $galleryData['name'], $galleryData['season'], $galleryData['copyright'], $galleryData['description'], $galleryData['path'] ) );

facing this error: fatal error: Call to a member function query() on a non-object.

plz help me. thanks