View Full Version : Error only on 1 php page connecting to db...

02-19-2008, 04:21 AM
I keep getting the following error but am connecting no differently to my database than any other page, is there elements that could effect this?

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/domains/html/file.php on line 180

Line 180 looks like so...

$quer2=mysql_query("SELECT DISTINCT category,cat_id FROM category order by category");

At the top of my php I have this...

if($_SESSION['session_started'] != "TRUE") session_start();

And there is no problem connecting on any other page so I am totally confused...

02-19-2008, 07:13 AM
What page is your connection code in? Add or die(mysql_error()); after the mysql_connect() call.