WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How to save form details into mysql?

[Resolved] How to save form details into mysql?

  • brprasanth16

    @brprasanth16

    Hi, i am created a form in my web page called employee details with three text boxes for id, name, salary and one for submit button. Now what i want is, after filling the form when the user is clicked on the submit button, i want to save that from details(id,name,salary) in MYSQL employee table. What code i have to write for that? and where i have to write?

    Thank You.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Please check the following link how wpdb work.

    http://codex.wordpress.org/Class_Reference/wpdb

    This link will be helpful to you.

    brprasanth16

    @brprasanth16

    coding is ok. but, my question is when i click submit button which file is going to execute? and where i have to write the code?

    Write the code in the page with condition

    if( isset($_REQUEST[‘submit_button_name’])):

    dbcode

    endif;

    brprasanth16

    @brprasanth16

    it’s working.

    Thank Q Shaan.wp

    Now i want to display a notification to user about data is successfully submited. How to do it?

    if( isset($_REQUEST[‘submit_button_name’])):
    dbcode….
    if dbexecution is successfully completed
    {
    <script>
    jQuery(‘.success_div’).show();
    </script>
    }
    endif;

    In css file, .success_div{display:none}

    brprasanth16

    @brprasanth16

    Thank Q ……….

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] How to save form details into mysql?’ is closed to new replies.