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:
Did you know?Explore Trending and Topic pages for more stories like this.
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

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

UPLOAD IMAGES NOT WORKING!
Hi there i have a upload script in which it uploads the picture to a folder than creates two thumbna

Create comparison matrix?
I want to create a comparison script for forum software and was wondering is there any tutorial or b

Inserting Data into a MS Access DB using PHP.
As part of my uni course I am doing a placement at a company whom want me to create a client zone fo

Change image filetype on upload?
Hi,
I've got a form which uploads an image to the server.
Is it possible to change the image t

division gives infinity anser
int main()
{
int z=0;
int i=1/z;
cout<
}

It doesn't throw a

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

I need desperate help with this php code integrated with flash please
Can someone please help me with this php code which I have been stuck on for weeks . I am trying to

PayPal Redirect Issue
When I have my paypal button set so that is redirects to http://empiremarketing.ca/order.php,it work

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