LMSouq
database Open

mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc... expects parameter 1 to be resource

IA
iamjonesy
1 month ago
3 views
Problem Description
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, boolean given This is my code: $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']; }

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base