WordPress.org

Ready to get started?Download WordPress

Forums

How to update i custome from? (1 post)

  1. Mahesh Digarse
    Member
    Posted 5 months ago #

    Hello
    I am new here i know WordPress but i am not experience in it so please help me out. i made a custom information getting form in which i put student info and its working fine but i don't know how to provide update feature in this. here is my simple code.

    <form onsubmit="return validateDate()" action="" method="post" name="myform" class="compform" id="myform">

    • <p>First Name:</p>
      <input type="text" name="firstname" id="firstname" value=""/>
    • <p>Middle Name:</p>
      <input type="text" name="middlename" id="middlename" value=""/>
    • <p>Last Name:</p>
      <input type="text" name="lastname" id="lastname" value=""/>

    </form>
    <?php
    if(isset($_POST['submit'])){
    global $wpdb;
    if($wpdb->insert( 'studentinfo', array( 'firstname' => $_POST['firstname'],'middlename' => $_POST['middlename'],'lastname' => $_POST['lastname'] ), array( '%s','%s','%s')
    ) == false) wp_die('Database Insertion failed'); else echo 'Database insertion successful<p />';
    }
    ?>

Reply

You must log in to post.

About this Topic