Help! ( MySQL Error: No database selected ) ????

Discussion in 'MySQL' started by Pudgyy, Feb 24, 2009.

  1. #1
    Just wondering if anyone can help me here.

    i am trying to install a uploader script and i get this error when installed.

    can someone help me please

    "MySQL Error: No database selected on line 25"

    
    <?php
    @define ( 'NO_AUTH_CHECK', 1 );
    require 'includes/commons.inc.php';
    require 'includes/pub_settings.inc.php';
    $tpl_main = new Template ( TPL_DIR . 'tpl_main.php' );
    
    // for public uploader
    $upload_max = get_byte_value ( ini_get ( 'upload_max_filesize' ) );
    $post_max = get_byte_value ( ini_get ( 'post_max_size' ) );
    $max_php_file_size = min ( $upload_max, $post_max );
    $max_filesize = $PUB['max_file_size'] > 0 ? $PUB['max_file_size'] * 1024 : $max_php_file_size;
    
    $restrictions = array
    (
        'max_file_size'	=> $max_filesize,
        'allowed_types'	=> $PUB['images_only'] ? 'jpg,jpeg,gif,png' : $PUB['allowed_filetypes'],
        'images_only'	=> $PUB['images_only']
    );
    $tpl_main->set ( 'restrictions', $restrictions );
    
    // Get latest users
    $new_users = array();
    $new_user_limit = (int)$UPL['SETTINGS']['new_user_limit'];
    $result = $mysqlDB->query ( "SELECT * FROM uploader_users ORDER BY userid DESC LIMIT $new_user_limit" );
    if ( $result->error() ) exit ( $mysqlDB->error ( __LINE__, __FILE__ ) );
    while ( false !== ( $user = $result->fetchRow('assoc') ) )
    {
        processUser ( $user );
        $new_users[] = $user;
    }
    $result->free();
    $tpl_main->set ( 'new_users', $new_users );
    
    PHP:
     
    Pudgyy, Feb 24, 2009 IP
  2. Pixel T.

    Pixel T. Well-Known Member

    Messages:
    1,205
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    170
    #2
    You need a file that connects to your MySQL server. Its usually called config.php. In this case it might be commons.inc.php. Double check that.

    Good Luck
     
    Pixel T., Feb 24, 2009 IP
  3. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #3
    It seems that the database details are missing in config file of the script.

    Kailash
     
    kailash, Mar 1, 2009 IP