这是一个管理页面,应该显示所选用户的所有数据我试图只显示一个用户的数据,但得到一个空页面:
<?php
if (isset($_POST['user']))
{
$user = $_POST['user'];
//if username has been selected
if($user == "none")
{
echo '<div class="error"><p>No user has been selected</p></div>';
echo '<meta HTTP-EQUIV="REFRESH" content="1; url=adminPanel.php">';
}
else
{
//form query
$query = "SELECT * FROM User WHERE user = '$user'";
//Execute query
$query_result = mysql_query($query)
or die(mysql_error());
echo '<table>';
while($user_data = mysql_fetch_array($query_result))
{
echo '<tr>';
echo '<td>'.$user_data['user'].'</td>';
echo '<td>'.$user_data['email'].'</td>';
echo '<td>'.$user_data['added'].'</td>';
echo '<td>'.$user_data['admin'].'</td>';
echo '<td>'.$user_data['type'].'</td>';
echo '</tr>';
}
echo '</table>';
}
}
?>
这里可能有什么问题?