<?php
require 'datacon.php';
$staffid ='asd';
$query="SELECT lecturers.staffid, tutors.staffid FROM lecturers , tutors WHERE lecturers.staffid = '".$staffid."', tutors.staffid = '".$staffid."' ";
if($result = mysql_query($query) ){
while($row = mysql_fetch_array($result)){
echo $row['staffid'];
echo "<br />";
}
}else if($result==''){
echo 'the query is empty';
}else{
echo die(mysql_error().'there was a failure');
}
?>
and this is the output
the query is empty

