heshan Posted August 21, 2012 Share Posted August 21, 2012 Hi all, I want something like this to be done. I want to add time table for each grade in a school. When a user enters grade, class and stream and click on "Add" button the relevant data should display. But in the following page there are no data to be selected in the drop down list. Can anyone solve my issue? Here is my coding.. <form name="form1" method="POST" action="addTimeTableDatabase.php"> <?php $con=mysql_connect("localhost","root",""); mysql_select_db("student_management",$con); $grade=$_GET["grade"]; $class=$_GET["class"]; $stream=$_GET["stream"]; ?> <table width="850" border="1" align="center" bgcolor="#00FFFF"> <tr> <td colspan="2"><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="25%"><img src="../../IMAGE/banner - Copy.jpg" alt="" width="186" height="136" /></td> <td width="75%" align="center" valign="middle"><div align="center"><img src="../../IMAGE/banner.jpg" alt="" width="733" height="137" /></div></td> </tr> </table></td> </tr> <tr> <td width="170"> </td> <td width="700"><table width="662" border="0"> <tr> <td width="124"><a href="../../Home page/new student registration/add_or_manage.php">Manage Data</a></td> <td width="124"> </td> <td width="124"> </td> <td width="124" align="center"><a href="../../add admin users/changePasword.php">Change Password</a></td> <td width="129" align="center"><a href="../../Home page/new student registration/signout.php">Signout</a></td> </tr> </table></td> </tr> <tr> <td height="59" valign="top"><ul id="MenuBar1" class="MenuBarVertical"> <li><a href="../../add admin users/add techer/addAdminUser.php">Add Admin Login</a> </li> <li><a href="../new student registration/newStudentRegistrationForm.php">Add Student</a></li> <li><a href="../../student attendance/add attendance/addStudentAttendance.php">Add Student Attendance</a> </li> <li><a href="../../Student time table/add1 time table/addTimeTable.php">Add Time Table</a></li> <li><a href="../../Student marks/add student marks/addStudentMark.php">Add Student Marks</a></li> <li><a href="../../manage subject/add subject.php">Add Subject</a></li> <li><a href="../../search student information/SearchStudentInformation.php">Search Student Information</a></li> <li><a href="../../student payments reports/studentsPayments.php">Student Payment Reports</a></li> <li><a href="../../Issue certificate/issueCertificate.php">Issue Certificates</a></li> </ul> <p> </p></td> <td><label><table width="666" border="0" align="center"> <tr> <td> </td> <td colspan="4"> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td colspan="4"><h3> <label>Add Time Table </label> </h3></td> <td> </td> <td> </td> <td width="47"> </td> </tr> <tr> <td colspan="7"> </td> <td> </td> </tr> <tr> <td width="17"> </td> <td width="99" align="center"><label>Grade</label> </td> <td width="81"><?php echo $grade;?> </td> <td width="59" align="center"><label>Class</label></td> <td width="93"><?php echo $class; ?></td> <td width="81" align="center"> Stream</td> <td width="155"><?php echo $stream; ?></td> <td> </td> </tr> <tr> <td colspan="7"> </td> <td> </td> </tr> <tr> <td colspan="8"><table width="655" height="529" border="1"> <tr> <td width="13"> </td> <td width="125"><label>Time</label> </td> <td width="94"><label>Monday</label> </td> <td width="94"><label>Tuesday</label> </td> <td width="94"><label>Wednesday</label> </td> <td width="94"><label>Thursday</label> </td> <td width="95"><label>Friday</label> </td> </tr> <tr> <td height="52"><label>1 </label> </td> <td><span id="sprytextfield1"> <input name="1s" type="text" id="textfield3" size="5" /> </span> <select name="1st" id="select"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield2"> <input name="1e" type="text" id="textfield4" size="5" /> </span> <select name="1et" id="select2"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td><select name="monday1" id="jumpMenu" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select></td> <td> <select name="tuesday1" id="jumpMenu9" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday1" id="jumpMenu17" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday1" id="jumpMenu25" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday1" id="jumpMenu33" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> <tr> <td><label>2</label> </td> <td><span id="sprytextfield3"> <input name="2s" type="text" id="textfield5" size="5" /> </span> <select name="2st" id="select3"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield4"> <input name="2e" type="text" id="textfield6" size="5" /> </span> <select name="2et" id="select4"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td> <select name="monday2" id="jumpMenu2" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="tuesday2" id="jumpMenu10" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday2" id="jumpMenu18" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday2" id="jumpMenu26" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday2" id="jumpMenu34" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> <tr> <td><label>3</label> </td> <td><span id="sprytextfield5"> <input name="3s" type="text" id="textfield7" size="5" /> </span> <select name="3st" id="select5"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield6"> <input name="3e" type="text" id="textfield8" size="5" /> </span> <select name="3et" id="select6"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td> <select name="monday3" id="jumpMenu3" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="tuesday3" id="jumpMenu11" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday3" id="jumpMenu19" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday3" id="jumpMenu27" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday3" id="jumpMenu35" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> <tr> <td><label>4</label></td> <td><span id="sprytextfield7"> <input name="4s" type="text" id="textfield9" size="5" /> </span> <select name="4st" id="select7"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield8"> <input name="4e" type="text" id="textfield10" size="5" /> </span> <select name="4et" id="select8"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td> <select name="monday4" id="jumpMenu4" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="tuesday4" id="jumpMenu12" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday4" id="jumpMenu20" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday4" id="jumpMenu28" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday4" id="jumpMenu36" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> <tr> <td> </td> <td colspan="6" align="center"><label>INTERVAL</label> </td> </tr> <tr> <td><label>5</label></td> <td><span id="sprytextfield9"> <input name="5s" type="text" id="textfield11" size="5" /> </span> <select name="5st" id="select9"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield10"> <input name="5e" type="text" id="textfield12" size="5" /> </span> <select name="5et" id="select10"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td> <select name="monday5" id="jumpMenu5" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="tuesday5" id="jumpMenu13" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday5" id="jumpMenu21" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday5" id="jumpMenu29" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday5" id="jumpMenu37" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> <tr> <td><label>6</label> </td> <td><span id="sprytextfield11"> <input name="6s" type="text" id="textfield13" size="5" /> </span> <select name="6st" id="select11"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield12"> <input name="6e" type="text" id="textfield14" size="5" /> </span> <select name="6et" id="select12"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td> <select name="monday6" id="jumpMenu6" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="tuesday6" id="jumpMenu14" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday6" id="jumpMenu22" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday6" id="jumpMenu30" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday6" id="jumpMenu38" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> <tr> <td><label>7</label> </td> <td><span id="sprytextfield13"> <input name="7s" type="text" id="textfield15" size="5" /> </span> <select name="7st" id="select13"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield14"> <input name="7e" type="text" id="textfield16" size="5" /> </span> <select name="7et" id="select14"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td> <select name="monday7" id="jumpMenu7" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="tuesday7" id="jumpMenu15" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday7" id="jumpMenu23" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday7" id="jumpMenu31" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday7" id="jumpMenu39" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> <tr> <td><label>8</label> </td> <td><span id="sprytextfield15"> <input name="8s" type="text" id="textfield17" size="5" /> </span> <select name="8st" id="select15"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> <span id="sprytextfield16"> <input name="8e" type="text" id="textfield18" size="5" /> </span> <select name="8et" id="select16"> <option value="am">am</option> <option value="pm">pm</option> </select> <br /> </td> <td> <select name="monday8" id="jumpMenu8" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="tuesday8" id="jumpMenu16" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="wednesday8" id="jumpMenu24" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="thursday8" id="jumpMenu32" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> <td> <select name="friday8" id="jumpMenu40" > <?php $query="SELECT subject_id,name FROM subject WHERE subject.not_available='no' and subject_id like '$grade/%'"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=\"".$row['subject_id']."\">".$row['name']."</option> \n "; } ?> </select> </td> </tr> </table></td> </tr> <tr> <td colspan="7"> </td> <td> </td> </tr> <tr> <td colspan="5"> <input type="hidden" name="grade" value="<?php echo $grade;?>"/> <input type="hidden" name="class" value="<?php echo $class;?>"/> <input type="hidden" name="stream" value="<?php echo $stream;?>"/> </td> <td> <input type="submit" name="button" id="button" value="Save" /> </td> <td> </td> <td> </td> </tr> <tr> <td colspan="7" align="center"> </td> <td> </td> </tr> </table> <p> </p> <p> </p></td> </tr> </table> </form> Quote Link to comment https://forums.phpfreaks.com/topic/267387-problem-arises-when-entering-time-table-data/ 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.