I have encountered this error that is driving me insane. It doesn't make any sense. I copied the code from another resource, except it doesn't work. The code is this:
$connection = msql_connect() || print("<p>Connect didn't work!</p>");
msql_select_db("dbname") || print("<p>DB Select didn't work!</p>");
$sql = "select * from test";
$sql_result = msql("dbname",$sql) || print("<p>SQL Error</p>");
if($sql_result)
{
while ($row = msql_fetch_array($sql_result))
{
$userName = $row["username"];
echo"<p>$userName</p>";
}
}
It does not like the msql_fetch_array line. It gives the error:
Warning: Supplied argument is not a valid mSQL result resource
This is a serious problem for me, and need it resolved. Please help.