www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] No Database Selected

  1. #1
    Join Date
    Apr 2008
    Location
    Kutztown, PA
    Posts
    26

    resolved [RESOLVED] No Database Selected

    Issue here is that even after I make a persistent (or regular connection, it does the same thing) AND use mysql_select_db, it still gives me the dreaded 'No Database Selected' message.

    I hope I'm just missing something and it's not a configuration issue...

    Here's my connection code:

    PHP Code:
    $hostname_connection1 "localhost";
    $database_connection1 "thedb";
    $username_connection1 "user";
    $password_connection1 "pass";
    $connection1 mysql_pconnect($hostname_connection1$username_connection1$password_connection1) or trigger_error(mysql_error(),E_USER_ERROR); 

    mysql_select_db($database_connection1$connection1); 

  2. #2
    Join Date
    Nov 2007
    Posts
    140
    mysql_error() may help you determine what the problem it.

    mysql_select_db($database_connection1, $connection1) or trigger_error(mysql_error(),E_USER_ERROR);

  3. #3
    Join Date
    Apr 2008
    Location
    Kutztown, PA
    Posts
    26
    Apparently, when the user in question does not have permissions to select/insert/update/delete it will throw this.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles