Jump to content

populate names from database records and then edit selected name row


jas21

Recommended Posts

Hello experts,

 

                I want to populate names from database records and then edit selected name row by clicking onthe edit button.

Below is the code for the same:


<form action="update.php">
<fieldset>
<legend>Adding Fresh Lead</legend>

Name:
<select name="name1">
<option value="1">Alison</option>
<option value="2">jack</option>
<option value="3">thomas</option>
<option value="4">roy</option>
</select>
<input type="submit" value="Edit" /><br>
<p><label for="name">Name</label> <input type="text"  name="name"/></p>
<p><label for="email">E-mail</label> <input type="text"  name="email" /><br /></p>
<p><label for="contact">Contact</label> <input type="text"  name="contact" /><br /></p>
<p><label for="requirement">Requirement</label> <input type="text"  name="requirement" /><br /></p>
<p><label for="date">Date</label> <input type="text"  name="date" value="<?php $b = time ();
  print date("d/m/y",$b) ; 
 ?> " /><br /></p>
<p><label for="priority" name="priority" >Priority</label>
<select name="priority">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>

<br /></p>
<p><label for="priority" name="priority" >Status</label>
<select name="priority">
<option value="1">Open</option>
<option value="2">Close</option>
<option value="3">Inprocess</option>
</select>
<br /></p>
<p><label for="price">Price </label> <input type="text" name="price" /><br /></p>
<p><label for="followup">Follow-Up</label> <input type="text" name="followup" /><br /></p>
<p class="submit"><input type="submit" value="Update" /></p>
</fieldset>
</form>

I want to populated all my names from database if i place any alphabet in the textbox name1. I want to search name by keywords as the first alphabet of name.

I have tried a lot but dint came to a conclusion. Really not understanding. So if some one can just help me out with the code.

 

I have used the below query for editing:

$result = mysqli_query($con,"SELECT * FROM persons where name1=' . $txt1'");

But now i am confused to populate name in textbox and then i have to edit the form.

I hope i have explained it fine. Please some one can help me out here.

 

Any help is apprecited. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.