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

having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. F

foreach loop, assistance request
I would like some guidance on the usage of foreach as I try to parse through a large database and wh

How to read CSS message data
Hi,
I have a requirement here. When working as a Dev angel for multiple customers its really di

Error In Syntax
I got this error:

Code: Parse error: syntax error, unexpected '>' in /home/bucket/publ

Help please - How to validate from 2 possible answers
Hi

I hope somebody can help me with what will probably be really simple, I'm pulling my hair

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.

Multiple forms on the same page (safari)
Hello everyone,

I have 3 forms on the same page, that opens in a new window and submits to a

Login logout link help
Hi all,

Im new to php and Im having trouble creating a login/logout link for my page that dis

PRotect my POST DATA... FROM HTML ATTACKS
I need to like let's say

If a user submit's his Prayer and he put's <meta refresh stuf

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