Error!

Fuel\Core\Database_Exception [ Error ]:

COREPATH/classes/database/mysql/connection.php @ line 111

106    protected function _select_db($database)
107    {
108        if ( ! mysql_select_db($database$this->_connection))
109        {
110            // Unable to select database
111            throw new \Database_Exception(mysql_error($this->_connection), mysql_errno($this->_connection));
112        }
113
114        static::$_current_databases[$this->_connection_id] = $database;
115    }
116

Backtrace

  1. COREPATH/classes/database/mysql/connection.php @ line 91
    86        }
    87
    88        // \xFF is a better delimiter, but the PHP driver uses underscore
    89        $this->_connection_id sha1($hostname.'_'.$username.'_'.$password);
    90
    91        $this->_select_db($database);
    92
    93        if ( ! empty($this->_config['charset']))
    94        {
    95            // Set the character set
    96            $this->set_charset($this->_config['charset']);
    
  2. COREPATH/classes/database/mysql/connection.php @ line 391
    386    }
    387
    388    public function escape($value)
    389    {
    390        // Make sure the database is connected
    391        $this->_connection or $this->connect();
    392
    393        if (($value mysql_real_escape_string((string) $value$this->_connection)) === FALSE)
    394        {
    395            throw new \Database_Exception(mysql_error($this->_connection), mysql_errno($this->_connection));
    396        }
    
  3. COREPATH/classes/database/connection.php @ line 463
    458        {
    459            // Convert to non-locale aware float to prevent possible commas
    460            return sprintf('%F'$value);
    461        }
    462
    463        return $this->escape($value);
    464    }
    465
    466    /**
    467     Quote a database table name and adds the table prefix if needed.
    468     *
    
  4. COREPATH/classes/database/query/builder.php @ line 125
    120                            // Set the parameter as the value
    121                            $value $this->_parameters[$value];
    122                        }
    123
    124                        // Quote the entire value normally
    125                        $value $db->quote($value);
    126                    }
    127
    128                    // Append the statement to the query
    129                    $sql .= $db->quote_identifier($column).' '.$op.' '.$value;
    130                }
    
  5. COREPATH/classes/database/query/builder/select.php @ line 334
    329        }
    330
    331        if ( ! empty($this->_where))
    332        {
    333            // Add selection conditions
    334            $query .= ' WHERE '.$this->_compile_conditions($db$this->_where);
    335        }
    336
    337        if ( ! empty($this->_group_by))
    338        {
    339            // Add sorting
    
  6. COREPATH/classes/database/query.php @ line 197
    192            // Get the database instance
    193            $db = \Database_Connection::instance($db);
    194        }
    195
    196        // Compile the SQL query
    197        $sql $this->compile($db);
    198
    199/*        if ( ! empty($this->_lifetime) AND $this->_type === DB::SELECT)
    200        {
    201            // Set the cache key based on the database instance name and SQL
    202            $cache_key 'Database_Connection::query("'.$db.'", "'.$sql.'")';
    
  7. APPPATH/classes/content.php @ line 322
    317        public function getLayout(){
    318            $layout_id '';
    319            $result DB::select('cms_template_m.layout_id')->from('cms_template_m')
    320                                ->join('cms_content_m','INNER')
    321                                ->on('cms_content_m.template_id''=' ,'cms_template_m.template_id')
    322                                ->where('cms_content_m.content_id''='$this->content_id)->as_object()->execute();
    323                //print_r(\Fuel\Core\DB::last_query());
    324            if(count($result) != 0){
    325                foreach($result as $rs) {
    326                    $layout_id $rs->layout_id;
    327                    break;
    
  8. APPPATH/classes/controller/content.php @ line 6
     1<?php
     2class Controller_Content extends Controller {
     3    public function action_index($session_id$content_id)
     4    {
     5        $content = new Content($session_id$content_id);
     6        $layout $content->getLayout();
     7        $view View::factory('layouts/'.$layout);
     8        $content->viewData($view);
     9        
    10        $block = new Block($session_id$content_id);
    11        $block->viewData($view);
    
  9. COREPATH/classes/request.php @ line 429
    424                logger(Fuel::L_INFO'Calling '.$class.'::before'__METHOD__);
    425                $controller->before();
    426            }
    427
    428            logger(Fuel::L_INFO'Calling '.$class.'::'.$method__METHOD__);
    429            call_user_func_array(array($controller$method), $this->method_params);
    430
    431            // Call the after method if it exists
    432            if (method_exists($controller'after'))
    433            {
    434                logger(Fuel::L_INFO'Calling '.$class.'::after'__METHOD__);
    
  10. DOCROOT/index.php @ line 42
    37
    38// Boot the app
    39require_once APPPATH.'bootstrap.php';
    40
    41// Generate the request, execute it and send the output.
    42$response Request::factory()->execute()->response();
    43
    44// This will add the execution time and memory usage to the output.
    45// Comment this out if you don't use it.
    46$bm Profiler::app_total();
    47$response->body(str_replace(array('{exec_time}''{mem_usage}'), array(round($bm[0], 4), round($bm[1] / pow(10242), 3)), $response->body()));
    

Prior Non-Fatal Errors

  1. Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50173 Library:50312 in COREPATH/classes/database/mysql/connection.php @ line 77
    72                $this->_connection mysql_pconnect($hostname$username$password);
    73            }
    74            else
    75            {
    76                // Create a connection and force it to be a new link
    77                $this->_connection mysql_connect($hostname$username$passwordTRUE);
    78            }
    79        }
    80        catch (ErrorException $e)
    81        {
    82            // No connection exists
    
  2. Warning: mysql_connect(): Access denied for user 'balitban_site'@'localhost' (using password: YES) in COREPATH/classes/database/mysql/connection.php @ line 77
    72                $this->_connection mysql_pconnect($hostname$username$password);
    73            }
    74            else
    75            {
    76                // Create a connection and force it to be a new link
    77                $this->_connection mysql_connect($hostname$username$passwordTRUE);
    78            }
    79        }
    80        catch (ErrorException $e)
    81        {
    82            // No connection exists
    
  3. Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in COREPATH/classes/database/mysql/connection.php @ line 108
    103     * @param   string  Database
    104     * @return  void
    105     */
    106    protected function _select_db($database)
    107    {
    108        if ( ! mysql_select_db($database$this->_connection))
    109        {
    110            // Unable to select database
    111            throw new \Database_Exception(mysql_error($this->_connection), mysql_errno($this->_connection));
    112        }
    113
    
  4. Warning: mysql_error() expects parameter 1 to be resource, boolean given in COREPATH/classes/database/mysql/connection.php @ line 111
    106    protected function _select_db($database)
    107    {
    108        if ( ! mysql_select_db($database$this->_connection))
    109        {
    110            // Unable to select database
    111            throw new \Database_Exception(mysql_error($this->_connection), mysql_errno($this->_connection));
    112        }
    113
    114        static::$_current_databases[$this->_connection_id] = $database;
    115    }
    116
    
  5. Warning: mysql_errno() expects parameter 1 to be resource, boolean given in COREPATH/classes/database/mysql/connection.php @ line 111
    106    protected function _select_db($database)
    107    {
    108        if ( ! mysql_select_db($database$this->_connection))
    109        {
    110            // Unable to select database
    111            throw new \Database_Exception(mysql_error($this->_connection), mysql_errno($this->_connection));
    112        }
    113
    114        static::$_current_databases[$this->_connection_id] = $database;
    115    }
    116
    

Prior Contents (show)