Sir, i have a little problem regarding my queries.. I try to display data from two different table using left outer join. but I found some error.. here's my code please check and tell me what is wrong..
f(isset($_GET['id'])){
$id = preg_replace('#[^0-9]#i','',$_GET['id']);
$result = mysql_query("SELECT A.cus_id, A.complaint, A.admin, A.datetime, B.firstname, B.email FROM tbl_complaint A LEFT OUTER JOIN tbl_customer B WHERE cus_id = '$id' ORDER BY datetime DESC ");
echo "<center><h4>Response</h4></center>";
echo "<div class='row' style='width:700px; height:200px; border:1px solid #CCC; overflow-y:scroll;'>";
while($row = mysql_fetch_array($result))
{
$complaint = $row['complaint'];
$cus_id = $row['cus_id'];
$datetime = $row['datetime'];
$admin = $row['admin'];
$firstname_email = $row['firstname'].' '.$row['email'];
echo "<div>";
if(empty($admin)) {
//nothing to show
}
else{
echo"<div><p class='csr-msg' >$admin</p></div><br>";
}//if empty condition
echo"<p class='user-msg'>$complaint</p></div><br>";
}//while
echo "</div>";
}
mysql_close();
please help thnx..