WordPress.org

Forums

[resolved] How to save form details into mysql? (7 posts)

  1. brprasanth16
    Member
    Posted 1 year ago #

    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.

  2. shaan.wp
    Member
    Posted 1 year ago #

    Please check the following link how wpdb work.

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

    This link will be helpful to you.

  3. brprasanth16
    Member
    Posted 1 year ago #

    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?

  4. shaan.wp
    Member
    Posted 1 year ago #

    Write the code in the page with condition

    if( isset($_REQUEST['submit_button_name'])):

    dbcode

    endif;

  5. brprasanth16
    Member
    Posted 1 year ago #

    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?

  6. shaan.wp
    Member
    Posted 1 year ago #

    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}

  7. brprasanth16
    Member
    Posted 1 year ago #

    Thank Q ..........

Topic Closed

This topic has been closed to new replies.

About this Topic