有問題,我需要連接2個SELECTs。我有這樣的代碼,但它把所有從$年齡頁的末尾,我需要它在同一行其他resutls將兩個SELECT連接成一個mysql_query
<?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();
?>
非常感謝你,它的工作! – ProfiThing 2013-03-03 08:49:09