我有下面的代碼有問題 -幫助PHP While循環
mysqli_select_db($connect,"publishers");
//using for the display of the offer box
$sql = "SELECT * FROM revbut WHERE onpublisher='$u'";
$g = mysqli_query($connect,$sql) or die(mysqli_error($connect));
mysqli_select_db($connect,"users");
//using for the display of the offer box
$db = "SELECT * FROM button WHERE sessionusername='$u'";
$s = mysqli_query($connect,$db) or die(mysqli_error($connect));
$user = mysqli_fetch_assoc($s);
while($geez = mysqli_fetch_assoc($g))
{
if($geez['onuser']) {
$globalname = $geez['sessionusername'];
include('js.php');
}
else if($user['sessionusername']){
include('js2.php');
}
else {
echo "Nothing in here.";
}
}
如果我刪除了while循環,它的工作原理。
你的意思是你只刪除`while(...)`,或while循環塊內的所有內容? – BoltClock 2011-01-22 18:17:04
你有什麼問題? – 2011-01-22 18:17:32