when I run the following code, I receive this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Abyss Web Server\htdocs\hp\login.php on line 7
$sql = 'SELECT * FROM `author` WHERE 1 AND `author _name` = '.$_POST['username'];
// Run the query, identifying the connection
$queryResource = mysql_query($sql, $connection);
// Fetch rows from MySQL one at a time
while ($row = mysql_fetch_array($queryResource, MYSQL_ASSOC)) {
echo($row['author_id']);
}
I've used similar code before, but cannot see why this code is bombing out on line 7 (while ($row = mysql_fetch_array($queryResource, MYSQL_ASSOC)) {). any help will be greatly appreciated, thanks.
note their is more code to the script, but i've only shown the bits that I feel are relevant