include("dbwrapper.php"); include("config.php"); include("css.php"); db_connect($dbhost,$dbuser,$dbpass,$dbdb); if (!$update) { $query = "select * from courses where id='$id'"; $r = db_query($query); $b = db_fetch_assoc($r); $title = $b['title']; $semester= $b['semester']; $year=$b['year']; $dept=$b['dept']; $id=$b['id']; $code=$b['code']; $instructor=$b['instructor']; $url=rawurldecode($b['url']); } if ($update) { // they have submitted the search form $url=urlencode ($url); if (!$instructor) $instructor=""; //$query ="update courses (semester,year,dept,code,url,title,instructor)"; //$query .= "VALUES('$semester','$year','$dept','$code','$url','$title','$instructor')"; $query ="UPDATE courses SET title='$title', semester='$semester',year='$year', url='$url', code='$code', instructor='$instructor' WHERE id='$id'"; $r = db_query($query); } if ($delete) { // they have submitted the search form $query ="DELETE FROM courses WHERE id='$id'"; $r = db_query($query); print "
Course Page Deleted |
";
print " ";
print "Search |
>
|