我试图从一个MySQL表中选择数据,但我得到以下错误消息之一:
Mysql_fetch_array()期望参数1为给定的资源布尔值
这是我的代码:
$username = $_POST['username'];
$password = $_POST['password'];
$result = mysql_query('SELECT * FROM Users WHERE UserName LIKE $username');
while($row = mysql_fetch_array($result)) {
echo $row['FirstName'];
}