Sending edited submissions to MySQL with PHP

  • rutauno1invias
    Fecha de consulta 5 de abril de 2024, 11:40

    Ya tengo conectado el envío de la información de mi formulario a una base de datos Mysql usando PHP, siguiendo un tutorial de jotforms https://www.jotform.com/help/126-how-to-insert-update-submissions-to-your-mysql-database-using-php/, funciona cuando hago el envío de una información nueva pero cuando edito una entrada no se hace la nueva inserción, como hago para que cuando se edite la entrada también se inserte la información

  • Neil Jotform Support
    Fecha de respuesta 5 de abril de 2024, 14:00

    Hi rutauno1invias,

    Thanks for reaching out to Jotform Support. Unfortunately, our Spanish Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Spanish, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.

    Now, let me help you with your question. To update records in your MySQL table when a submission is edited, you'll need to set up webhooks that can be triggered both on form submission and when a submission is updated. Let me walk you through it:

    1. In Form Builder, in the orange navigation bar at the of the page, click on Settings.
    2. Go to Integrations and search for Webhook.

      Sending edited submissions to MySQL with PHP Image 1 Screenshot 30
    3. Now, enter your endpoint or Webhook URL in the Add WebHook field.
    4. Then, click on the Complete Integration button.

      Sending edited submissions to MySQL with PHP Image 2 Screenshot 41

    Configure the webhook to send data to a new PHP script that you will create specifically for updating records when a submission is edited. You'll also specify that this webhook should trigger on "Submission Edited." Create a new PHP script that will receive data from the Jotform webhook and update the records in your MySQL table accordingly. You can also check out this guide to learn more about Webhook integration.

    Give it a try and let us know how it goes.

  • rutauno1invias
    Fecha de respuesta 18 de abril de 2024, 10:35

    Hola buenos días,

    La URL que pondré ahí en el campo de webhook, es la misma URL del archivo PHP al cual quiero apuntarle?


    Cordialmente,

  • Neil Jotform Support
    Fecha de respuesta 18 de abril de 2024, 13:43

    Hi rutauno1invias,

    Thanks for getting back to us. Yes, that is correct. You'll also have to make sure that you're updating the right table as well.

    Aside from my suggestion, you can also use POST method. Here's a guide you can check out for more information.

    Reach out again if you have any other questions.

 
Su respuesta