I hope you are all doing alright.
Is it possible to connect a gform entry to a database created with Python and stored in my PC with a little variation of the following code?
add_action("gform_after_submission_1", "input_fields", 10, 2);
function input_fields($entry, $form)
{$password = "password";$username = "username";$servername = "localhost";$dbname = "db";$fname = $entry["12.3"];$lname = $entry["14.6"];$email = $entry["4"];$address1 = $entry["5.1"];$address2 = $entry["15.2"];$city = $entry["16.3"];$state = $entry["18.4"];$zip = $entry["17.5"];$bbd = $entry["7"];$upc = $entry["6"];$subject = $entry["10"];$question = $entry["2"];$con=mysqli_connect($servername, $username, $password, $dbname);
mysqli_query($con,"INSERT INTO wp_contacts (id, name, last_name,
state, city, address, address_2, bbd, subscribe, upc, email, subject,
comments, phone, user_ip, answer, answered_by, zipcode, category_id,
active, contact_captcha, answered_date, dept, computer_name, created)
VALUES ('', '$fname', '$lname', '$state', '$city', '$address1',
'$address2', '$bbd', '', '$upc', '$email', '$subject', '$question',
'', '', '', '', '$zip', '', '', '', '', '', '', '')");
}
I have tried creating a snippet with the following PHP code:
add_action("gform_after_submission_1", "input_fields", 10, 2);
function input_fields($entry, $form)
{
$dbname = "forms.db";
$fname = $entry["12.3"];
$lname = $entry["14.6"];$con=mysqli_connect($fileadres);
mysqli_query($con,"INSERT INTO vragenlijst (f_name, l_name,)
VALUES ('$fname', '$lname');}
Any help will be much appreciated.