I have a email subscription to my site and I want to insert to my WordPress database so I can export the email listing. I already created table wp_email_subscription with 4 fields ID, name, email and date created. what will be the query for this? is there any wordpress database script to use?
Leave a Reply
You must be logged in to post a comment.
WordPress provides the
$wpdb
class of functions for interacting with the database.To insert an email address you could do something like:
More info on the WordPress Codex.
This is if you want to insert values to your table. You do not have to use $wpdb->email_subscription for the prefix as it’s the table you created yourself, otherwise, if you were inserting values to default WordPress tables you would prefer doing
$wpdb->users etc.
you can go for
go through this for better understanding:
http://codex.wordpress.org/Class_Reference/wpdb
All information you can read here