Reputation: 171
My client want to have form collecting the user data and save to external database that is on different hosting of the wordpress site.
I need to have two forms, one is for contact us purpose and the second for newsletter registering. Both forms need to collect the data and save it to the database on different tables.
I found plugin that let me make form on wordpress and plugin that let my save the data on the database wordpress use, but this in not what I need.
I found this solution Create a form and save data in a external DB with Wordpress but it do not help me.
I tried to run some PHP code (and learn it this way, because I do not know php) to get the data but I got nothing.
it is possible to do what I am asking? Is there some plugin to do this?
I do not ask for code, but some help will great.
Thanks
Upvotes: 1
Views: 8093
Reputation: 1803
The code in this page helps you create a second database connection, once you connect the second database, you can store data to it using routine WordPress database commands
http://bavotasan.com/2011/access-another-database-in-wordpress/
$newdb = new wpdb($DB_USER, $DB_PASSWORD, $DB_NAME, $DB_HOST);
$newdb->show_errors();
Hope this helps, let me know if there is still an issue.
Upvotes: 1