I have a table containing three fields Name, city, Marks
If I select name filed in dropdownlist box I want the rest of the fields to be displayed in Text boxes.
I have a table containing three fields Name, city, Marks
If I select name filed in dropdownlist box I want the rest of the fields to be displayed in Text boxes.
form name :-> form_db.php
Code:<?php if(isset($_POST['posted'])=='true') { $connect=mysql_connect('localhost','root',''); $db=mysql_select_db('dir_db',$connect); // Now We Perform Search Operation, that main logic for that Query,that perform opertion for only when we select the Name from drop down List and in table we specify only one row data. if(isset($_POST['required_select'])== 'Name' ) { $query=mysql_query("SELECT * FROM table_name", $connect); while($row = mysql_fetch_array($query)) { $column1=$row['name']; $column2=$row['city']; $column3=$row['marks']; } } } ?> <form name="form" method="post" action="form_db.php"> <select name="required_select"> <option value="Name">Name</option> <option value="City">City</option> <option value="Marks">Marks</option> </select--> <b>City :</b> <input type="text" name="city" value="<?php echo $column2; ?>" size="25"> <b>Marks :</b> <input type="text" name="marks" value="<?php echo $column3; >"size="25"> <input type="hidden" name="posted" value="true" /> </form>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks