次のような声明がありますが、IF ELSEは機能していないようですか?私はそれがちょうどwhileループを実行し、結果がヌルでないかどうかをチェックせずにH1を表示することを意味していませんか?IF文は機能しますが、ELSEは機能しません。
明らかなエラーは誰でも見ることができますか?
if($interests_result != 0) {
print "<h1>Users with the same interests!</h1><div style='clear:both;'>";
while($interests_row = mysql_fetch_array($interests_result, MYSQL_ASSOC))
{
$int_user = $interests_row['user_id'];
$int_twit_user = $interests_row['twitterUser'];
$divLeft = '<div class="user-box" id="thediv_'.$int_user.'"><div class="twithandlepic"><img src="http://api.twitter.com/1/users/profile_image/';
$divRight = '<div class="twithandle">';
$clearDiv = '<div style="clear:both;"></div>';
print $divLeft.strip_tags($int_twit_user)."?size=normal\" style=\"width:48px; height:48px;\"/><br \/>".$int_twit_user.$divRight."<a href='javascript:void(0);' id='".$interests_row['user_id']."' class='getIntPoint'>Get ".$interests_row['coff']." <input type='hidden' value='".$interests_row['coff']."' class='credoff' name='credoff'/> credit(s)</a><br /></div>$clearDiv</div></div>";
}
print $clearDiv."</div>";
}
else
{
print "No users to display!";
}
あるinterests_resultに割り当てられた値を...
$interests_query = "SELECT * FROM produgg_users
join user_interests on produgg_users.id = user_interests.user_id
where (interest = '$interest1' OR interest = '$interest2' OR interest = '$interest3') and produgg_users.id != '".$usersClass->userID()."' and credits >= coff and produgg_users.id NOT IN (select concat_ws(',', followedID) from produgg_activity where followerID = '".$usersClass->userID()."') ORDER BY coff DESC LIMIT 30;";
$interests_result = mysql_query($interests_query) or die(mysql_error());
あなたは '$ interests_result'にどのような価値を割り当てていますか? – Quentin
IveがQuentinを更新しました... – Liam