mysql クエリの order by に問題があります。" WHERE adder
='$followuser' " がなければクエリは正常に動作しますが、WHERE を使用すると ORDER BY は機能しません。助けてください。:)私のコードは次のとおりです。
$time=time();
$checkfollowing=mysql_query("SELECT * FROM `follow` WHERE `follower`='$session'") or die(mysql_error()); /* Check if is user following somebody */
if(mysql_num_rows($checkfollowing) == FALSE){ /* He's following no one */
echo "You follow noone";
die();
}elseif(mysql_num_rows($checkfollowing) == TRUE){ /* He's following somebody */
while($row11=mysql_fetch_array($checkfollowing)){
$followuser=$row11['get_follow'];
$fcontent=mysql_query("SELECT * FROM `followcontent` WHERE `adder`='$followuser' ORDER BY id DESC") or die (mysql_error()); /* Follow content */
while($row=mysql_fetch_assoc($fcontent)){
$id=$row['id'];
$photourl=$row['photourl'];
$adder=$row['adder'];
echo "<hr class='style'><br><div id='newadder'>".$adder."</div><a href='photo/?id=".$id."'><img src='".$photourl."' class='newfolimg'></a>";
}
} }
本当にありがとうございました :))