require_once("./Connections/root.php");
session_start();
$user = $_SESSION['MM_Username'];
$q = mysql_query("SELECT id FROM performer WHERE username = '$user'");
$r = mysql_fetch_assoc($q);
$q1 = mysql_query("SELECT poster_id, wall_msg FROM performer_info WHERE id = '$r[id]'");
$r1 = mysql_fetch_assoc($q1);
$q2 = mysql_query("SELECT username FROM performer WHERE id = '$r1[poster_id]'");
$r2 = mysql_fetch_assoc($q2);
echo $r2['username'] . " : " . $r1['wall_msg'];
是否可以在单个查询和结果中使用所有这些查询?
我想,我需要使用内部连接,但我不知道该怎么做
$_SESSION['MM_Username'] 是登录用户,用户名