在我的门户网站的首页中,我将显示数据库二表中所选记录的概述,其中uid字段在两者中都很常见。
$sql="SELECT e.* ,d.* FROM emitra_basic As e INNER JOIN emitra_device as d ON d.uid=e.uid where e.block='$user'";
$result = $conn->query($sql);
while($row = $result->fetch_array()) {
$total_records =$result->num_rows;
if($row['service']=="active")
{$totalact++;}
if($row['m_atm']=="yes")
{$totalatm++;}
if($row['bio_m']=="yes")
{$totalbio++;}......and some more fields and for output
echo "<table>"
echo "<tr><td>". "Total Shop:" .totalatm. "</td>";
echo "<tr><td>" ."Active Shop:" .$totalact."</td>";
echo "<tr><td>" ."Shop with bio metric:" .$atal."</td></tr>";
及其正常工作
它显示如下:
Total Shop:10
Active Shop:5
Shop with ****:*
现在在点击这个号码的时候想要这个设施,如果点击活跃的商店前面的5,并且从数据库显示这5个商店的全部细节的话,有详细的设施意味着。如何为此创建查询..