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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Location
    East Side/West Side
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts

    "Error: No Database Selected"

    I get MySQL Err Num 1046 - No Database Selected when I put this code in...

    PHP Code:
    require("common.inc.OLD.php"); // nevermind why I named it that
    $link mysql_connect($database$database_user$database_password); // all is in config.dat.php, which is requried thru common.inc
    mysql_select_db($database); 
    Is that not right?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    I think it's mysql_db_select($database)

    Use it all the time and I can't remember how it goes now

  • #3
    Regular Coder
    Join Date
    Feb 2003
    Location
    East Side/West Side
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Ahh, I see why now

    It should be
    PHP Code:
    require("common.inc.OLD.php"); // nevermind why I named it that
    $link mysql_connect(localhost$database_user$database_password); // all is in config.dat.php, which is requried thru common.inc
    mysql_select_db($database); 
    Or if $database is localhost, change mysql_select_db($database) to whatever your database is named, like mysql_select_db($databasename)
    Last edited by Nightfire; 02-27-2003 at 11:00 PM.

  • #5
    Regular Coder
    Join Date
    Feb 2003
    Location
    East Side/West Side
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There we go

    Thanks - programming for a game I haven't programmed for since October...tough tryin to get back to it


  •  

    Posting Permissions

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