数据库出错数据库错误发生错误编号:1046在codeignitor
错误编号:1046
否数据库中选择
SELECT * FROM ts_themes
WHERE theme_status
= 1
文件名: C:/xampp/htdocs/Themeportal/application/models/DatabaseModel.php
行号:23
数据库出错数据库错误发生错误编号:1046在codeignitor
错误编号:1046
否数据库中选择
SELECT * FROM ts_themes
WHERE 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
);
甲PHP错误遇到 严重性:警告 消息:mysqli的:: real_connect():(HY000/1049):未知数据库
组这样' '数据库'=> 'studentsnotes',' –
甲PHP错误遇到 严重性:警告 消息:的file_get_contents(C:\ XAMPP \ htdocs中\ Themeportal \应用\ controllersapplication /配置/ verify.txt):未能打开流:没有这样的文件或目录 文件名:控制器/ Default_controllers.php 线编号:4 Backtrace: File:C:\ xampp \ htdocs \ Them eportal \应用\控制器\ Default_controllers.php 行:4 功能:的file_get_contents 文件:C:\ XAMPP \ htdocs中\ Themeportal \应用\控制器\ Home.php 线:20 功能:需要 文件:C :\ xampp \ htdocs \ Themeportal \ index.php 行:318 函数:require_once –
数据库设置第一配置数据库设置的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();
请提供更多有关信息,请环境或你想要做的事情。 – davidmatas
按照类和文件命名的方式为codeigniter https://www.codeigniter.com/user_guide/general/styleguide.html#file-naming'Database_model.php'和'class Database_model extends CI_Model {}' – user4419336
谢谢你这么多 –