\n"; $query1 = 'select * from department'; $query2 = 'select * from department where dnumber = 6'; // empty $query3 = 'select * from employee'; $query4 = 'select fname, lname, ssn, bdate, sex, salary, super_ssn, dno from employee'; $query5 = ' select e.fname, e.lname, d.dname as dept, s.lname as boss from employee e join department d on e.dno = d.dnumber left join employee s on e.super_ssn = s.ssn'; $query6 = ' select e.fname, e.lname, p.pname, w.hours, p.plocation from employee e, project p, works_on w where e.ssn = w.essn and p.pnumber = w.pno order by e.lname' ; $query7 = 'select * from employee where ssn = \'371294856\''; // empty $query8 = 'select foo from employee'; // bad column $query = $query7; print "

demo query

"; print "
$query

\n"; //$queryres = $dbconn->query($query); $pquery = $dbconn -> prepare($query); if ($pquery == FALSE) { print ("query \"$query\" could not be prepared"); die(); } $res = $pquery -> execute(); // no arguments to the query! if ($res == FALSE) { print ("query \"$query\" could not be executed"); die(); } table_format_pdo($pquery); print ""; ?>