Home › Forums › Quform WordPress › Problem with MySQL input
- This topic has 2 replies, 2 voices, and was last updated 8 years, 4 months ago by Ally.
- AuthorPosts
- December 30, 2015 at 4:36 pm #17757mobilemadmanParticipant
Hi,
I have problem with custom input into my MySQL database,
I have very large form so table in DB is also large, all fields are correct as I copy and pasted every field from form I created. So no problem there.
My settings look like:
Save submitted form data (CHECKED)
Use WordPress database (NOT CHECKED)All login info to custom DB are ok
now, I checked and added error_log function to file
// Okay, so now we can save form data to the custom database table if configured
if (count($fields = $form->getDbFields())) {
foreach ($fields as $key => $value) {
$fields[$key] = $form->replacePlaceholderValues($value);
}if ($form->getUseWpDb()) {
global $wpdb;
$wpdb->insert($form->getDbTable(), $fields);
} else {
$cwpdb = new wpdb($form->getDbUsername(), $form->getDbPassword(), $form->getDbName(), $form->getDbHost());error_log('iform 900@ common.php: ' . "\n\r". print_r($cwpdb));
$cwpdb->insert($form->getDbTable(), $fields);
error_log('fields: ' . "\n\r". print_r($fields));
}
}
and the error log shows
[30-Dec-2015 16:29:11 UTC] iform 900@ common.php: 1 [30-Dec-2015 16:29:11 UTC] fields: 1
no entry to my DB,
is that because I am not filling out some data fields in form while testing? I get the email but the data does not go into MySQL table…
Please advise.
December 30, 2015 at 5:57 pm #17758mobilemadmanParticipantsorry, forgot about 1 in error_log
error_log(‘fields: ‘ . “\n\r”. print_r($fields,1));it tells me there is bad DB connection
Error establishing a database connectionyou may include some kind of logs in next version of your awesome tool :-)))
thanks and have happy New Year!!
January 5, 2016 at 3:26 pm #17793AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.