Search the Community
Showing results for tags 'dynamic dropdown'.
-
Hello, i have a simple database containing three tables subject_code subject_name subject_description i have a dropdown list in which i fetch data of 'subject code' now i want to show the other field data in the textboxes of the selected row item from the drop down list can anybudy help me out in code _________________________________ Code __________________________________________ <?php $connect_error = 'Sorry we are experiencing some connection problems.'; mysql_connect('localhost', 'root', '') or die ($connect_error); mysql_select_db('lr_u') or die ($connect_error); function close(){ mysql_close(); } function query() { $sql = mysql_query("SELECT * FROM ref_subject"); while($rows = mysql_fetch_array($sql)) { echo '<option value="' . $rows['subject_code'] . '">' . $rows['subject_code'] . '" </option>'; } } ?> <h1> Creating an Examination Paper </h1> <p> Welcome to the section where you can create an online examination paper </p> <h3> Subject </h3> <form action="" method="post"> <ul> <li> Subject Code*:<br> <select name="dropdown"> <?php query() ?> </select> <?php close() ?> <br> Select The Subject Code Of the Course. <br> </li> <li> Subject Name*:<br> <input type="text" name="subject_name"> </li> <li> Subject Discription*:<br> <TEXTAREA ROWS=10 COLS=50 type="text" name="subject_description" ></TEXTAREA> </li> <br> <p> kindly sumbit to check if the coudse is valid </p> <input type="submit" value="Submit"> </li> </ul> </form> exam_create.php