<?php include "faculty.php"; $obj = new Faculty(); if (isset($_REQUEST['st'])) { $fa = $_REQUEST['st']; $str = "select * from FACULTY where Faculty_Name like '%{$fa}%' OR Faculty_Id='{$fa}'"; $result = $obj->query($str); $row = $obj->fetch(); echo "Suggestion: "; echo "<select>"; while ($row) { echo "<option value=''>" . $row['Faculty_Name'] . "</option>"; $row = $obj->fetch(); } echo "</select>"; }
<?php include "faculty.php"; $obj = new Faculty(); if (isset($_GET['fid'])) { $id = $_GET['fid']; $name = $_GET['fna']; $str = "update FACULTY set Faculty_Name='{$name}' where Faculty_Id='{$id}'"; //echo "id=$id name= $name"; $re = $obj->query($str); if (!$re) { //die('Updation Failed for the Faculty '.mysql_error()); } else { //echo "<br>"; // echo "<center><b><font size=4>Updation is Successful on $name</font></b></center>"; header('location:facultyView.php'); } } else { header('location:facultyView.php'); }
<tr> <td id="content"> <div id="divStatus" class="status"> status message </div> <div id="divContent" class="courseOutline"> <?php if (isset($_GET['fid'])) { include "faculty.php"; $obj = new Faculty(); $fid = $_GET['fid']; $str = "select * from FACULTY where Faculty_Id='{$fid}'"; $res = $obj->query($str); $row = $obj->fetch(); echo "<center>"; echo "<br>"; echo "<center><b><font size=5>Faculty Update</font></b></center><br>"; echo "<center><div><input type='text' name='fid' id='f' value='{$row['Faculty_Id']}' readonly></div><br>"; echo "<div><input type='text' name='fna' id='na' value='{$row['Faculty_Name']}'></div><br>"; echo "<div><input type='submit' onclick='updateFaculty()' value='Save'></div><br></center>"; echo "</center>"; } ?> </td> </tr> </table> <div id="footer"> Copyright © Friends Solution