Jump to content

MySQL query problem


muskelmann098

Recommended Posts

When I try to run the following piece of code, I get this error:

Warning: 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:

      
/*--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 in advance :)

Link to comment
https://forums.phpfreaks.com/topic/185465-mysql-query-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.