Error Number 1046 Codeigniter
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn error number 1046 no database selected codeigniter more about Stack Overflow the company Business Learn more about hiring developers or
Error Number 1054 In Codeigniter
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow error number 1146 in codeigniter Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error Number: 1046 No database selected - CodeIgniter up
Error Number 1064 Codeigniter
vote -1 down vote favorite When I load my model to run the sql file in codeigniter. I get a error saying no database selected but there is. The error occurs when I click my button to go to the next stage. It some how needs to load database first before load sql. Not to sure on how to make it work. if I refresh page it loads. error number 1048 codeigniter Should not have to refresh page should be done as soon as click on button Error Error Number: 1046 No database selected CREATE TABLE `country` ( `country_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `iso_code_2` varchar(2) NOT NULL, `iso_code_3` varchar(3) NOT NULL, `address_format` text NOT NULL, `postcode_required` tinyint(1) NOT NULL, `status` tinyint(1) NOT NULL DEFAULT ‘1’, PRIMARY KEY (`country_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; Filename: C:\xampp\htdocs\codeigniter\system\database\DB_driver.php Line Number: 330 On Controller $data['button_continue'] = $this->lang->line('button_continue'); $data['button_back'] = $this->lang->line('button_back'); if ($this->form_validation->run() == false) { $this->load->view('template/step_3', $data); } else { $this->load->model('install/model_install'); $this->model_install->database_install(); $this->model_install->database_connect(); $this->model_install->dump_sql(); redirect('step_4'); } Model public function dump_sql() { $file = APPPATH . 'modules/install/config/database.sql'; if (!file_exists($file)) { exit('Could not load sql file: ' . $file); } $lines = file($file); if ($lines) { $sql = ''; foreach($lines as $line) { if ($line && (substr($line, 0, 2) != '--') && (substr($line, 0, 1) != '#')) { $sql .= $line; if (preg_match('/;\s*$/', $line)) { $sql = str_replace("DROP TABLE IF EXISTS `", "DROP TABLE IF EXISTS `" . $this->input->post('dbprefix'), $sql); $sql = str_replace("CREATE TABLE IF NOT EXISTS `", "CREATE TABLE IF NOT EXISTS `" . $this->input->post('dbprefix'), $sql); $sql = str_replace("CREATE TABLE `", "CREATE TABLE `" . $this->input->post('dbprefix'), $sql); $sql = str_replace("INSERT INTO `", "INSERT I
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
Error Number 1062 Codeigniter
this site About Us Learn more about Stack Overflow the company Business
Codeigniter Pdo Driver
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up http://stackoverflow.com/questions/23842565/error-number-1046-no-database-selected-codeigniter No database selected error in CodeIgniter running on MAMP stack up vote 0 down vote favorite First off, does anyone know of a good place to get help with CodeIgniter? The official community forums are somewhat disappointing in terms of getting many responses. I have ci installed on a regular MAMP stack, and I’m working on this tutorial. However, I have only gone http://stackoverflow.com/questions/4578939/no-database-selected-error-in-codeigniter-running-on-mamp-stack through the Created section, and currently I am getting a No database selected error. Model: $school, 'district' => $district ); $this->db->insert('your_stats', $data); } } View: load->helper('form'); ?>
Controller: input->post('submit')) { $school = $this->input->xss_clean($this->input->post('school')); $district = $this->input->xss_clean($this->input->post('district')); $this->load->model('submit_model'); // Add the post $this->submit_model->submitForm($school, $district); } $this->load->view('main_view'); } } database.php $db['default']['hostname'] = "localhost:8889"; $db['default']['username'] = "root"; $db['default']['password'] = "root"; $db['default']['database'] = "stats_test"; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; config.php $config['base_url'] = "http://localhost:8888/ci/"; ... $config['index_page'] = "index.php"; ... $config['uri_protocol'] = "AUTO"; So, how come it’s giving me this error message? A Database Error Occurred Error Number: 1046 No database selected INSERT INTO `your_stats` (`school`, `district`) VALUES ('TJHSST', 'FairFax') Is there any way fo
Sign in Pricing Blog Support Search GitHub This repository Watch 209 Star 1,689 https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/686 Fork 815 benedmunds/CodeIgniter-Ion-Auth Code Issues 27 Pull requests 4 Projects 0 Wiki Pulse Graphs New issue Error 1046 how to solve ? #686 Closed malix213 http://www.codingforums.com/php/322900-codeigniter-controller-sql-load-error.html opened this Issue Dec 23, 2014 · 13 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned error number 7 participants malix213 commented Dec 23, 2014 Hi, I use MAMP Version 3.0.7.3 (3.0.7.3) When i access using EMAIL:admin@admin.com PASSWORD:password it's show ,me this error here are my codeIgniter config Database in phpmyadmin database.php ion_auth.php Thank you for your support Abdelmalek abdulwahidgul24085 commented Dec 23, 2014 You are not error number 1046 providing database name Username : admin@admin.com Password : password Database name: "what ever is your database name" … On Dec 23, 2014 8:48 AM, "Abdelmalek LAHMAR" ***@***.***> wrote: Hi, I use MAMP Version 3.0.7.3 (3.0.7.3) When i access using ***@***.*** PASSWORD:password it's show ,me this error [image: screen shot 2014-12-23 at 3 37 23 am]
New? Today's Posts FAQ Rules Guidelines Search Advanced Search Forum :: Server side development PHP Codeigniter Controller SQL Load Error If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Enjoy an ad free experience by logging in. Not a member yet? Register. Results 1 to 2 of 2 Thread: Codeigniter Controller SQL Load Error Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible 05-23-2014,03:15 PM #1 riwakawd View Profile View Forum Posts Visit Homepage Regular Coder Join Date Jan 2013 Location Australia Posts 120 Thanks 22 Thanked 0 Times in 0 Posts Codeigniter Controller SQL Load Error Hello when I use codeigniter and have small issue. When I click on my continue button on my form. I get an error when loading the sql file. PHP Code: ErrorNumber:1046
Nodatabaseselected
CREATETABLE`rwd_country`(`country_id`int(11)NOTNULLAUTO_INCREMENT,`name`varchar(128)NOTNULL,`iso_code_2`varchar(2)