Results 1 to 9 of 9

Thread: MySQL Error

  1. #1
    Join Date
    Nov 2004
    Posts
    28

    Default MySQL Error

    Dear Admin

    I can not log in to my chat

    http://alexxx.bizhat.com/chat/

    It says password incorect? i try to login to admin.php I am getting

    Notice: MySQL error 1146 : Table 'alexxx_bizhat_com.flashchat_12users' doesn't exist in /home/vhosts/alexxx.bizhat.com/chat/inc/classes/db.php on line 52

    Notice: MySQL error 1146 : Table 'alexxx_bizhat_com.flashchat_12users' doesn't exist in /home/vhosts/alexxx.bizhat.com/chat/inc/classes/db.php on line 52

  2. #2
    Join Date
    Sep 2004
    Location
    Maryland, USA
    Posts
    332

    Default

    well the name of your table should be just "alexxx_bizhat_com" without the rest, because it's trying to find "alexxx_bizhat_com.flashchat_12users" in which that table doesn't exist...

    but I am no good with SQL so I probably don't know what I am talking about.

  3. #3
    Join Date
    Nov 2004
    Posts
    28

    Default

    I dont know why it does not create that

  4. #4
    Join Date
    Nov 2004
    Posts
    28

    Default

    What vercion of MySQL is here

  5. #5
    Join Date
    Nov 2004
    Location
    Russia, Novosibirsk
    Posts
    634

    Default

    Quote Originally Posted by alexxx.bizhat.com
    What vercion of MySQL is here
    Software versions:
    MySQL 4.20 (standart)
    php 4.3.7
    Perl 5

  6. #6
    Join Date
    Mar 2005
    Location
    Norfolk
    Posts
    44

    Default

    alexxx.bizhat.com I definitely agree with your words.

  7. #7
    Join Date
    Aug 2004
    Location
    USA
    Posts
    996

    Default

    Be sure to have right username that is on your mysql DB.

    like keep it similar to db name.

    MySQL Name: cfeclan8_loyal
    Username : cfeclan8_loyal
    Username Password: loyal

    so you can remember that stuff, I kind of do that to my mysql databases that get edited alot.
    Nobody really excpets what the password is because I use really long passwords :P

  8. #8
    Join Date
    Jul 2005
    Posts
    28

    Default

    If the error says "Table 'alexxx_bizhat_com.flashchat_12users' doesn't exist", then he is probably connecting correctly to the DB, or otherwise he would get a "Cannot connect to DB" error message.

    Anyhow, you may use a script like this to connect to your DB host and tell whether you are connected or not. And whether you could open the DB correctly.

    function open_dB ($dB = "YOUR_DB_NAME", $dB_host = "localhost", $dB_user = "YOUR_USERNAME", $dB_pass = "YOUR_PASSWORD") {
    if ( !($dB_con = mysql_connect($dB_host, $dB_user, $dB_pass)) ) { //Get connection handler
    return 0; //Error connecting to DB server
    }
    if ( !(mysql_select_db($dB,$dB_con)) ) { // mysql> use $dB
    return 0; //Error opening DB
    }
    return $dB_con;
    }

    With this function you can debug your script pretty easily. You may want to return different error codes for the two error cases there might be ("Error connecting to DB server" and "Error opening DB").
    Make sure you replace YOUR_DB_NAME, YOUR_USERNAME and YOUR_PASSWORD with the actual data.
    For alexxx's case, the YOUR_DB_NAME should be: alexxx_bizhat_com.


    Then, the table's name, as I infer from alexxx's post, is just "flashchat_12users", so when doing a Query, just use that to state the table's name. For example:

    $table = "flashchat_12users";

    //Show DB table
    $result = mysql_query("SELECT * FROM $table");
    while ($myrow = mysql_fetch_array($result)) {
    printf("ID: %s\n", $myrow["ID"]);
    printf("Name: %s\n", $myrow["name"]);
    }

    Note: I made the assumption that your table is composed of two fields: ID and name.

    Hope this is useful for you.

  9. #9
    Join Date
    Sep 2005
    Location
    bhubaneswar
    Posts
    58

    Default

    dear friend
    make sure the sql table creation script is correct.


    thanks

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
  •