Page 1 of 1
Why is this database conn showing a Bool False?
Posted: Wed Dec 03, 2014 10:26 am
by simonmlewis
Code: Select all
$resultuk = mysql_query ("SELECT id FROM products WHERE romancode = '$rowcat->romancode' AND paintedalternative IS NOT NULL", $dbuk);
var_dump($resultuk);
print_r($resultuk);
[text]bool(false)[/text]
This should be showing nothing. When I do a 'count' of the results rows, it should be coming up as zero.
This page has a database connection to it's 'home' database, and is specifically querying it with ", dbsup, and that works without errors. So I don't think it is the db conn, as it's not erroring the connection.
If I query this in phpmyadmin, it comes up with zero rows.
Re: Why is this database conn showing a Bool False?
Posted: Wed Dec 03, 2014 10:56 am
by Celauran
What does mysql_error() say?
Re: Why is this database conn showing a Bool False?
Posted: Wed Dec 03, 2014 11:08 am
by simonmlewis
It seems to be looking at the 'home' database.... that doesn't make sense.
I'm doing this locally at the moment:
Code: Select all
$dbuk = mysql_connect("localhost","root","")or die ('Could not connect to site.co.uk');
mysql_select_db('site', $dbuk) or die ('Could not connect to site.co.uk Database');
$dbsup = mysql_connect("localhost","root","")or die ('Could not connect to jsupport.co.uk');
mysql_select_db('support', $dbsup) or die ('Could not connect to support.co.uk Database');