Closed Thread
Results 1 to 3 of 3

Thread: Couldn't select database table

  1. #1
    fleuv53 is offline x10Hosting Member fleuv53 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    6

    Couldn't select database table

    Hi,

    I just tried to select a table by using php but it won't select the database table. I did checked my script, it must work!

    Code:
    $con = mysql_connect("$host", "$user", "$pass"); 
    if (!$con)
    {
      die('Could not connect: ' . mysql_error());
    }
    // here it stops
    mysql_select_db("users", $con)or die("Couldn't select database table.");
    
    .....
    
    mysql_close($con);
    so you can see my table name is users just like it says in phpmyadmin. Now I'm thinking am I wrong or is there something wrong in phpmyadmin.

    Greetz,

    - Fleuv

  2. #2
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: Couldn't select database table

    I don't see a database "users" in your account; I see one that is prefixed with your cpanel name, and then ends with _uee (cpanel_uee).


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  3. #3
    fleuv53 is offline x10Hosting Member fleuv53 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    6

    Re: Couldn't select database table

    found problem
    db = *_uee
    table = users

    var's

    $data=*_uee
    $table=users

    Changed: mysql_select_db("users", $con)or die("Couldn't select database table.");
    To: mysql_select_db("$data", $con)or die("Couldn't select database table.");

Closed Thread

Similar Threads

  1. Could not select database. No database selected issue
    By sxm65 in forum Programming Help
    Replies: 4
    Last Post: 07-04-2011, 08:52 PM
  2. Replies: 1
    Last Post: 02-17-2010, 07:54 AM
  3. couldn't connect to database
    By mazafaka in forum Free Hosting
    Replies: 2
    Last Post: 10-10-2009, 09:41 AM
  4. How do I only select the last 5 rows of a table in a database?
    By IonCannon218 in forum Programming Help
    Replies: 7
    Last Post: 03-19-2009, 09:18 AM
  5. Couldn't connect to MySQL database!
    By thefox91 in forum Free Hosting
    Replies: 5
    Last Post: 01-27-2008, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers