Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Error only on 1 php page connecting to db...

    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?

    Code:
    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...

    PHP Code:
    $quer2=mysql_query("SELECT DISTINCT category,cat_id FROM category order by category"); 
    At the top of my php I have this...

    PHP Code:
    <?php 
        
    if($_SESSION['session_started'] != "TRUE"session_start();
    require_once(
    "php/funct.php");
    require_once(
    "database/db.php");
    ?>
    And there is no problem connecting on any other page so I am totally confused...

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    What page is your connection code in? Add or die(mysql_error()); after the mysql_connect() call.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •