我有一点问题,我以前从未使用过 JOIN,这是第一次,我遇到了一些问题:
<?php
//$count to keep the counter go from 0 to new value
$count=0;
//I need to select the level for the users building first, meanwhile i also
//need to get the money_gain from the table buildings, which is a table that
//is common for each member, which means it doesnt have a userid as the other table!
//And then for each of the buildings there will be a $counting
$qu1 = mysql_query("SELECT building_user.level,buildings.money_gain FROM building_user,buildings WHERE building_user.userid=$user");
while($row = mysql_fetch_assoc($qu1))
{
$count=$count+$row['level'];
echo $row['level'];
}
?>
所以基本上我听说你应该用一个共同的柱子把它们绑在一起,但是,在这种情况下,这不是任何..我现在只是迷路了?
编辑哦,对了,我也需要用正确的 money_gain 取出正确的级别,在 building_user 中它的“buildingid”和在建筑物中,它只是“id”!虽然不知道如何发表共同声明!