MySQL query problem

Posted on 16th Feb 2014 by admin

When I try to run the following piece of code, I get this error:
QuoteWarning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/muskelmann098/public_html/build.php on line 37

Here is the area of the code where I think the problem is:
Code:
/*--36--*/ $b = "SELECT * FROM users WHERE town = '$town' AND username = '$name'";
/*--37--*/ $b_res = mysql_query($b,$conn)or die(mysql_error());
/*--38--*/ $barray = mysql_fetch_array($b_res)or die(mysql_error());
/*--39--*/ $blev = $barray["$building"];

I'm not really sure what is wrong with the SQL query as I'm using almost exactly the same syntax a few lines above. I hope someone here might see where I messed up.

Thanks

Other forums