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

Help with some dates
I have a list of dates in an array:

$mondays = array(
strtotime("October 12, 2009

need help to creat database
Hello Team, please guys i am stuck from three days with paypal issue for IPN but no luck yet now i w

i have no idea why this isn't working
Code: <?php
session_start();
include("connect.php");

error_reporting(E

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

help with calculations on a flat text file
hello,
I have this code below that is attached to a flat file like this:
Email:LastName:FirstN

mysqli_fetch_assoc returns multiple arrays, how to return a single array
Hello, I am using mysqli_fetch_assoc which is returning multiple rows, so it looks like:

Code

Beginner PHP code help
Hi I'm new to php but if someone could please read the question below and help it would be great.

IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized h

values in array being escaped
I would like to submit some values - back to the same form for checking before processing...

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

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