所以我试图从用户表中选择用户名,如果他们在一个帮派中。
使用的变量:
$member_gang = mysql_fetch_assoc(mysql_query("SELECT level,gangid,rating FROM user_stats WHERE id = '" . $_SESSION['user']['id'] . "'"));
$gang_info = mysql_fetch_assoc(mysql_query("SELECT * FROM gangs WHERE id = '".$member_gang['gangid']."'"));
这是我想展示它的时候。
$getmembers = mysql_fetch_assoc(mysql_query("SELECT * FROM user_stats WHERE gangid = '" . $gang_info['gangid'] . "'"));
$displaymembers = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '" . $getmembers['id'] . "'"));
echo 'One Member of this gang is: <b>'.$displaymembers['username'].' </b>:)';
(我确实有数据库连接等。)它没有回显用户名?!
编辑:我不擅长 PHP,我不明白准备好的语句?