Web Hosting Forums

Results 1 to 4 of 4

This is a discussion on newbie in the Hosting Talk & Chit-chat forum
Hi, I've set up a mysql database and can connect OK in PHP but when calling mysql_select_db() I get the error 1046; No Database Selected, ...

  1. #1
    Loyal Client
    Join Date
    Nov 2003
    Posts
    39

    newbie - err 1046, no db selected

    Hi,

    I've set up a mysql database and can connect OK in PHP but when calling mysql_select_db() I get the error 1046; No Database Selected, which is really what I was trying to do ;-)

    Any ideas what might be causing this or how to get more info? I'm new to this.

    Thanks!
    Last edited by wbrook; 05-29-2004 at 10:44 AM.

  2. #2
    Ron
    Guest
    1) Are you able to enter mysql and select the database interactively?

    Secure Shell into your account
    Type: mysql -u <user_name> -p [ENTER]
    [Type Password Here and press ENTER]
    Type: use <database_name>; [ENTER]

    2) Did you connect to the database and sign in as an authorized user in php?

    Good luck.

  3. #3
    Loyal Client
    Join Date
    Nov 2003
    Posts
    39
    I'm carrying on in this new thread since my subject was so lame in this one. Sorry for the confusion.

  4. #4
    Loyal Client
    Join Date
    Mar 2003
    Posts
    74
    are you trying to conect to the database remotely?

    this error is (i think) associated with rights issues, so if you are trying to access remotely, you will have to make sure that you add an access host. In the control panel, go to add access host and type in *

    b.t.w. post all your relevant php code then we can help more effectively

Bookmarks

Posting Permissions

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