MySQL query problem


Posted on 16th Feb 2014 07:03 pm 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

No comments posted yet

Your Answer:

Login to answer
77 Like 28 Dislike
Previous forums Next forums
Other forums

More pug propaganda.
http://www.youtube.com/watch?v=8Kkrmubsgf8

The commercial is definitely worth watching pug aw

PHP Form to Variable.
Hi! I have written a HTML-form code in DreamWeaver CS3 (in a PHP doc) and I really need it to work s

Saving data from a form into a file
Hey everybody,

Sorry, I am really new to PHP coding and such but a project kind of got thrust

PHP MySQL Return Results Issue
Hi guys,

I'm running joomla and made a module which is using ajax.
Basically i just have a

Select question
Hi,

First I would like to say that php is pretty new for me..
so please don't shoot me if

Text file to .Dat file Conversion in PHP
Hi All,
Could anybody provide code for Text file to .Dat file Conversion in PHP.

Tha

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

Multiple server callbacks (NOT POSTBACKS)
Hello, I have 2 different javascript client side functions that are on timers. When the timers elap

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash