I am trying to select data from a MySQL table, but I get one of the following error messages:
mysql_fetch_array() expects parameter 1 to be resource,
Put quotes around $username
. String values, as opposed to numeric values, must be enclosed in quotes.
$result = mysql_query("SELECT * FROM Users WHERE UserName LIKE '$username'");
Also, there is no point in using the LIKE
condition if you're not using wildcards: if you need an exact match use =
instead of LIKE
.