Database Query error

Hi guys.

I am running Dolphin 6.1 adfree Orca and before I uploaded the site to a server, everything was working fine on my localhost.

I uploaded the files and now I can't even access the files, it is returning this error:

"Database query error"

Straight after this i am receiving a bug report email with the following details:

Database error in Underground Hang-Out Zone
Query:
SELECT `ID` FROM `LocalizationLanguages` WHERE `Name` = 'en-us'
 
Mysql error:
Table 'octopa.LocalizationLanguages' doesn't exist
 
Found error in file /home/octopa/public_html/inc/languages.inc.php
at line 100. Called db_value function
with erroneous argument #0
 
Debug backtrace:
Array
(
    [1] => Array
        (
            [file] => /home/octopa/public_html/inc/db.inc.php
            [line] => 115
            [function] => db_res
            [args] => Array
                (
                    [0] => SELECT `ID` FROM `LocalizationLanguages` WHERE `Name` = 'en-us'
                    [1] => 1
                )
 
        )
 
    [2] => Array
        (
            [file] => /home/octopa/public_html/inc/db.inc.php
            [line] => 133
            [function] => db_arr
            [args] => Array
                (
                    [0] => SELECT `ID` FROM `LocalizationLanguages` WHERE `Name` = 'en-us'
                    [1] => 1
                )
 
        )
 
    [3] => Array
        (
            [file] => /home/octopa/public_html/inc/languages.inc.php
            [line] => 100
            [function] => db_value
            [args] => Array
                (
                    [0] => SELECT `ID` FROM `LocalizationLanguages` WHERE `Name` = 'en-us'
                )
 
        )
 
    [4] => Array
        (
            [file] => /home/octopa/public_html/inc/languages.inc.php
            [line] => 72
            [function] => checkLangExists
            [args] => Array
                (
                    [0] => en-us
                )
 
        )
 
    [5] => Array
        (
            [file] => /home/octopa/public_html/inc/languages.inc.php
            [line] => 46
            [function] => tryToGetLang
            [args] => Array
                (
                    [0] => en-us,en;q=0.5
                )
 
        )
 
    [6] => Array
        (
            [file] => /home/octopa/public_html/inc/languages.inc.php
            [line] => 27
            [function] => getCurrentLangName
            [args] => Array
                (
                )
 
        )
 
    [7] => Array
        (
            [file] => /home/octopa/public_html/inc/membership_levels.inc.php
            [line] => 24
            [args] => Array
                (
                    [0] => /home/octopa/public_html/inc/languages.inc.php
                )
 
            [function] => require_once
        )
 
    [8] => Array
        (
            [file] => /home/octopa/public_html/inc/modules.inc.php
            [line] => 24
            [args] => Array
                (
                    [0] => /home/octopa/public_html/inc/membership_levels.inc.php
                )
 
            [function] => require_once
        )
 
    [9] => Array
        (
            [file] => /home/octopa/public_html/inc/admin.inc.php
            [line] => 23
            [args] => Array
                (
                    [0] => /home/octopa/public_html/inc/modules.inc.php
                )
 
            [function] => require_once
        )
 
    [10] => Array
        (
            [file] => /home/octopa/public_html/join.php
            [line] => 4
            [args] => Array
                (
                    [0] => /home/octopa/public_html/inc/admin.inc.php
                )
 
            [function] => require_once
        )
 
)
 
 
Called script: /join.php
 
Request parameters:
Array
(
    [gk_temp_width] => 900
)
 
 
--
Auto-report system
 

It looks like it is not connecting to the database right? I do not know how this can be. Upon upload I changed the settings in the inc/header.inc.php file to reflect the new paths and passwords. Could it be cron obs because I am not sure if it is set up correctly?

 

Quote · 5 Sep 2008

is your header.php defo correct ?

Quote · 5 Sep 2008

$site['ver']               = '6.1';
$site['build']             = '1';
$site['title']             = 'Underground Hang-Out Zone';
$site['url']               = "http://www.octopa.co.zw/";
$admin_dir                 = "admin";
$site['url_admin']         = "{$site['url']}$admin_dir/";
$site['url_aff']           = "{$site['url']}aff/";
$site['profileImage']      = "{$site['url']}media/images/profile/";
$site['profileBackground'] = "{$site['url']}media/images/profile_bg/";
$site['profileSound']      = "{$site['url']}media/sound/";
$site['profileVideo']      = "{$site['url']}media/video/";
$site['sharingImages']     = "{$site['url']}media/images/sharingImages/";

$site['mediaImages']       = "{$site['url']}media/images/";
$site['gallery']           = "{$site['url']}media/images/gallery/";
$site['flags']             = "{$site['url']}media/images/flags/";
$site['blogImage']         = "{$site['url']}media/images/blog/";
$site['sdatingImage']      = "{$site['url']}media/images/sdating/";
$site['smiles']            = "{$site['url']}media/images/smiles/";
$site['banners']           = "{$site['url']}media/images/banners/";
$site['imagesPromo']       = "{$site['url']}media/images/promo/";
$site['tmp']               = "{$site['url']}tmp/";
$site['preCheckout']       = "{$site['url']}checkout/pre_checkout.php";
$site['plugins']           = "{$site['url']}plugins/";
$site['base']              = "{$site['url']}templates/base/";




$site['email']             = "excellence@octopa.co.zw";
$site['email_notify']      = "excellence@octopa.co.zw";
$site['bugReportMail']     = "excellence@octopa.co.zw";



$dir['root']               = "/home/octopa/public_html/";
$dir['inc']                = "{$dir['root']}inc/";
$dir['profileImage']       = "{$dir['root']}media/images/profile/";
$dir['profileBackground']  = "{$dir['root']}media/images/profile_bg/";
$dir['profileSound']       = "{$dir['root']}media/sound/";
$dir['profileVideo']       = "{$dir['root']}media/video/";
$dir['sharingImages']      = "{$dir['root']}media/images/sharingImages/";

$dir['mediaImages']        = "{$dir['root']}media/images/";
$dir['gallery']            = "{$dir['root']}media/images/gallery/";
$dir['flags']              = "{$dir['root']}media/images/flags/";
$dir['blogImage']          = "{$dir['root']}media/images/blog/";
$dir['sdatingImage']       = "{$dir['root']}media/images/sdating/";
$dir['smiles']             = "{$dir['root']}media/images/smiles/";
$dir['banners']            = "{$dir['root']}media/images/banners/";
$dir['imagesPromo']        = "{$dir['root']}media/images/promo/";
$dir['tmp']                = "{$dir['root']}tmp/";
$dir['cache']              = "{$dir['root']}cache/";
$dir['plugins']            = "{$dir['root']}plugins/";
$dir['base']               = "{$dir['root']}templates/base/";
$dir['classes']            = "{$dir['inc']}classes/";

$video_ext                 = 'avi';
$MOGRIFY                   = "/usr/local/bin/mogrify";
$CONVERT                   = "/usr/local/bin/convert";
$COMPOSITE                 = "/usr/local/bin/composite";
$PHPBIN                    = "/cgi-bin/php5.cgi";

$db['host']                = 'localhost';
$db['sock']                = '';
$db['port']                = '';
$db['user']                = 'octopa';
$db['passwd']              = 'xxxxx';
$db['db']                  = 'octopa';


define('BX_DIRECTORY_PATH_INC', $dir['inc']);
define('BX_DIRECTORY_PATH_ROOT', $dir['root']);
define('BX_DIRECTORY_PATH_BASE', $dir['base']);
define('BX_DIRECTORY_PATH_CACHE', $dir['cache']);
define('BX_DIRECTORY_PATH_CLASSES', $dir['classes']);

define('DATABASE_HOST', $db['host']);
define('DATABASE_SOCK', $db['sock']);
define('DATABASE_PORT', $db['port']);
define('DATABASE_USER', $db['user']);
define('DATABASE_PASS', $db['passwd']);
define('DATABASE_NAME', $db['db']);



//check safe_mode
if( (int)ini_get( 'safe_mode' ) )
{
echo '<b>Warning.</b> Dolphin cannot work in safe mode';
exit;
}

//check mbstring
if( !extension_loaded( 'mbstring' ) ) {
echo '<b>Warning!</b> Dolphin cannot work without <b>mbstring</b> extension.
Please go to the
<a href="http://www.boonex.com/trac/dolphin/wiki/GenDolTShooter">Dolphin Troubleshooter</a>
and solve the problem.';
exit;
}

//check correct hostname
$aUrl = parse_url( $site['url'] );
if( isset($_SERVER['HTTP_HOST']) and $_SERVER['HTTP_HOST'] != $aUrl['host'] and $_SERVER['HTTP_HOST'] != $aUrl['host'] . ':80' )
{
header( "Location:http://{$aUrl['host']}{$_SERVER['REQUEST_URI']}" );
exit;
}



// check if install folder exists
if ( file_exists( $dir['root'] . 'install' ) )
{
$ret = <<<EOJ
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>Dolphin Smart Community Builder Installed</title>
<link href="install/general.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="main">
<div id="header">
<img src="install/images/boonex_logo.gif" alt="" /></div>
<div id="content">
<div class="installed_pic">
<img alt="Dolphin Installed" src="install/images/dolphin_installed.jpg" />
</div>

<div class="installed_text">
Please, remove INSTALL directory from your server and reload this page to activate your community site.
</div>
</body>
</html>
EOJ;
echo $ret;
exit();
}

// set error reporting level
error_reporting(E_ALL & ~E_NOTICE);
set_magic_quotes_runtime(0);
ini_set('magic_quotes_sybase', 0);

// set default encoding for multibyte functions
mb_internal_encoding('UTF-8');

//--- Ray Integration ---//
require_once($dir['root'] . "ray/modules/global/inc/header.inc.php");
require_once($dir['root'] . "ray/modules/global/inc/content.inc.php");
//--- Ray Integration ---//
?>

Quote · 5 Sep 2008

 $db['db']                  = 'octopa'; - shouldnt your database name be 'something_something' ?

Quote · 5 Sep 2008

I could change it. But something like what? like "me_myself" ?? is the underscore really important. Its worth a try thougn but besides this everything else is proper hey?

Quote · 5 Sep 2008

go into your cpanel and then mysql

 

/there it should have the correct database name

Quote · 5 Sep 2008
 The database name is indeed "octopa". The password is correct as well. On my computer everything was working well. The site on my localhost is still running well. I do not get what is happening now! Could it be cron jobs etc? I am not sure if I set it up correctly but it shouldn't affect the start page at least! Ok...This is what I did: I created a file with PHP commands and there were no errors. but the site is still not starting. This is file is not part of dolphin. I just wanted to chek if the connection to the database is fine. It is returning no error. SO what is the problem?
Quote · 5 Sep 2008

ok. I had forgetten to run a query on the database. so the final result after:

<?php
$header = include_once("inc/header.inc.php");
if(!$header){
die ("Could not access database settings<br>".mysql_error());
}
$connect = mysql_connect("localhost", "octopa", "xxxx");
if(!$connect){
die ("Could not process stage two<br>".mysql_error());
}
$query = "SELECT `ID` FROM `LocalizationLanguages` WHERE `Name` = 'en-us'";

$result = mysql_query($query);
if(!$result){
die ("Something is wrong with the table<br>".mysql_error());
}
?>

"Something is wrong with the table
No database selected."

That should help hey.

Quote · 5 Sep 2008

Hi guys. I'm really worried about the status of the site right now. Seems I cant connect to my database for some reason. Is there anything else I should do or should I install dolphin from scratch on my server?

Here is what I have in my mind...if i can just put an "install" folder on my server and in place of the default database (that comes with dolphin) I put the old one..will it work? Be cause I will be keeping my files and everything might run smooth hey?

Please help!

Quote · 5 Sep 2008

u are missing this table by the looks of things

 

Table 'octopa.LocalizationLanguages' doesn't exist

 

did u back up the database previously?..if so restore it

Quote · 5 Sep 2008

u are missing this table by the looks of things

Table 'octopa.LocalizationLanguages' doesn't exist

did u back up the database previously?..if so restore it

Thanks for the quick response. I think i'm missing the database as a whole. If you look closely at the error that it generated when I ran my own file...the mysql error that came is: NO DATABASE SELECTED.

Quote · 5 Sep 2008

i have sent u a message

Quote · 5 Sep 2008
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.