我的表结构在图片下面的链接中
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。让我解释一下,如果值为myuid
4,那么我想要u.id=1
,或者如果值为fuid
4,我想要u.id=6
提前谢谢..任何人都可以帮我..