私のテーブル構造は、下の画像のリンクにあります
http://appricart.com/test/ftblstr.png
phpコードは次のとおりです。
<?php
include 'config.php';
include 'head.php';
$mid = $_POST['myuid'];
$tf = mysql_query("select f.fuid, f.myuid, u.username as writer, u.avatar from friends as f, users as u where f.myuid='$mid' or f.fuid='$mid' and u.id='$reqid'");
$tfc = mysql_num_rows($tf);
echo "<div style='background: #e9e9e9'>Friends ($tfc)</div>";
while ($frns = mysql_fetch_array($tf))
{
?>
<?php echo $frns['writer']; ?><br/>
<?php
}
?>
ここではu.id
、 の値$mid
が 4 であるかのように値が必要です。次に、1 または 6 のような他の行の値が必要です。 の値が 4 の場合はmyuid
説明u.id=1
し
ます。助けて..fuid
u.id=6