有问题,我需要加入 2 个 SELECT。我有这个代码,但它把所有从 $age 到页面末尾,我需要它与其他结果在同一行
<?php
mysql_connect("***", "***", "***") or die(mysql_error());
mysql_select_db("***");
$result = mysql_query("SELECT * FROM business");
$age = mysql_query("SELECT DATEDIFF( CURRENT_DATE, founded ) as date_difference FROM business");
while($row = mysql_fetch_array($result))
{
?><li class="onebusiness <?php echo $row['category']?>"><a href="<?php
echo $row['link'];?>"><img src="<?php
echo $row['img'];?>" height="125" width="125"/><p class="name"><?php
echo $row['name'];?></p><p class="age"><?php
echo $row['founded'];?></p></a></li><?php
}
while($row = mysql_fetch_array($age))
{
?><p class="age"><?php echo $row['date_difference']?></p><?php
}
mysql_close();
?>