jackgoddy123 Posted January 8, 2014 Share Posted January 8, 2014 Hie, I am quite stuck up with my application. All i want to do is select member id and click on edit button. As soon as the button is clicked then the form textbox space must be filled with that selected member id. Then after making the changes the form should updated by at the last by clicking the updatet button. Below is the code which i tried as far: My index.php page: <?php mysql_connect('localhost', 'root', '') or die(mysql_error()); echo "Tick <p>"; mysql_select_db("test") or die(mysql_error()); echo "Tick"; $id = $_GET['id']; $query = mysql_query("SELECT * FROM records WHERE id = '$id'") or die(mysql_error()); while($row = mysql_fetch_array($query)) { echo ""; $name = $row['name']; $email = $row['email']; $contact = $row['contact']; $requirement = $row['requirement']; }; ?> <form action="update.php?id=<?php echo "$id" ?>" method="post"> <!--Name: <input type="text" name="name" value= value='".$row['name']."'><br>--> name:<?php echo"<input name=\"name\" type=\"text\" id=\"name\" value=\"" .$name. "\">"; ?> Email: <input type="text" name="email" value="<?php echo "$email" ?>"><br> Contact: <input type="text" name="contact" value="<?php echo "$contact" ?>"><br> Requirement: <input type="text" name="requirement" value="<?php echo "$requirement" ?>"><br> <input type="Submit"> </form> All i want is to load data in the form textbox automatically by clicking on edit button. Please some one could help me out to solve my problem. Dont know what am i missing. Any help is appreciated. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/285211-edit-and-update-button-on-the-same-form-in-php/ Share on other sites More sharing options...
Solution mac_gyver Posted January 8, 2014 Solution Share Posted January 8, 2014 since you didn't state what sort of problem you are having or where you are stuck at in doing this, we cannot help since we don't have a clue what you need help on, i.e we are not standing right next to you and you must communicate effectively to get help. Quote Link to comment https://forums.phpfreaks.com/topic/285211-edit-and-update-button-on-the-same-form-in-php/#findComment-1464462 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.