I want to display services table status='A', g1='G1'and add_servicess table g1='G1', type='E' titles.this is mysql query.
$services_sql="SELECT services.id, services.title,services.link,services.link_open,add_services.aid,add_services.tittle
FROM services
LEFT JOIN add_services
ON services.status='A' AND services.g1='G1' AND add_services.g1='G1' AND add_services.type='E'
";
$result = db::getInstance()->query($services_sql);
/*** loop over the results ***/
$chklogin_val = $result->rowCount();
foreach($result as $row) {
if($acc_status=="A") {
echo '<div class="servicebox">
<div class="s_title"><h3>'.$row["title"].'</h3></div>
<div class="s_img" ><a href="'.$row["link"].'" target="'.$row["link_open"].'" ><img width="'.$_SESSION['img_width'].'" height="'.$_SESSION['img_height'].'" src="service/'.$row["id"].'.jpg" /></a></div>
</div> ';
echo '<div class="servicebox">
<div class="s_title"><a href="page.php?id='.$row['aid'].'" target="_blank"><h3>'.$row["tittle"].'</a></h3></div>
</div> ';
}
}
but its display same title in 2 times.eg i have column tittle "abc".it's display abc in two times.