I have a WordPress site in which I use the gravitational form. I would like to take one of the forms of gravity that I use and paste the data into another table. (In addition to the table of gravitational form). I use Gravity Form after submitting to capture the values of my specific form (3) and run the SQL statement. Here is the link explaining the hook: http://www.gravityhelp.com/documentation/page/Gform_after_submission
However, nothing is added to the new table (users). I can’t even tell if the script is working. The tables of the "default" form and the table of new users are in the same database. This is what my PHP looks like:
add_action("gform_after_submission_3", "input_fields", 10, 2);
function input_fields($entry, $form){
$entry["1"] = '$name';
$entry["2"] = '$email';
$entry["3"] = '$purchase_date';
$entry["4"] = '$order_number';
$SQL = "INSERT INTO users ( userID, email, name, purchase_date, order_number) VALUES ( '', '$email' , '$name', '$purchase_date', '$order_number')";
}
I grab values using a Gravity Form input object. More on this here: http://www.gravityhelp.com/documentation/page/Entry_Object
The form is written to the default table, but not to my new "users" table. Any suggestions? Let me know if I need to provide more information. Thanks for any help!
source
share