Support » Fixing WordPress » How to update i custome from?

  • 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=””/>

    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 />’;

  • The topic ‘How to update i custome from?’ is closed to new replies.