发生数据库错误
错误号:1046
未选择数据库
选择 * 从ts_themes
哪里theme_status
= 1
文件名:C:/xampp/htdocs/Themeportal/application/models/DatabaseModel.php
行号:23
发生数据库错误
错误号:1046
未选择数据库
选择 * 从ts_themes
哪里theme_status
= 1
文件名:C:/xampp/htdocs/Themeportal/application/models/DatabaseModel.php
行号:23
管理您的数据库设置application/config/database.php
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'database_name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
首先配置你的数据库设置 application/config/database.php
那么您的查询将是
$this->db->select('*');
$this->db->from('ts_themes');
$this->db->where('theme_status',"1");
$query=$this->db->get();
return $query->result();