\n"; if ($linux){ $query= "WITH mycourses AS ( SELECT course FROM enroll WHERE linux = $1) SELECT course, title, day, time, room FROM schedule WHERE course in (SELECT course from mycourses) order by dayo,time"; pg_connect("host=10.18.0.13 dbname=timetable user=mickey password=MoUsE"); $result=pg_query_params($query,array($linux)); while ($row=pg_fetch_assoc($result)) { print "\n"; foreach ($row as $field=>$value){ $value=htmlspecialchars($value); print "\t<$field>$value\n"; } print "\n"; } } print ""; ?>