codeigniter-2

CSV Import Library for CodeIgniter [closed]

戏子无情 提交于 2019-12-17 18:23:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Need to implement csv or xls import into Application created using CodeIgniter. Is there any library for this? Any suggestion appreciated. 回答1: Here is an easy way to do this. I don't know what people do but i use this This is my csv reader library <?php if (!defined('BASEPATH')) exit('No direct script access

Join query of two databases in codeigniter

爷,独闯天下 提交于 2019-12-17 16:50:44
问题 I need to write a join query of two tables from two databases and fetch the joined data. For eg, consider I have a database db1 which has some tables named companies, plans, customers. Suppose I need to join the two tables companies and plans with another table 'cdr' on another database db2 by grouping them using a similar column. The query which I'm running right now is given below: function get_per_company_total_use ($custid) { $this->DB1->select('ph_Companies.CompanyName'); $this->DB1-

Join query of two databases in codeigniter

你离开我真会死。 提交于 2019-12-17 16:50:29
问题 I need to write a join query of two tables from two databases and fetch the joined data. For eg, consider I have a database db1 which has some tables named companies, plans, customers. Suppose I need to join the two tables companies and plans with another table 'cdr' on another database db2 by grouping them using a similar column. The query which I'm running right now is given below: function get_per_company_total_use ($custid) { $this->DB1->select('ph_Companies.CompanyName'); $this->DB1-

CodeIgniter compatibility with PHP version?

﹥>﹥吖頭↗ 提交于 2019-12-17 16:41:51
问题 I am using CodeIgniter 2.2.6 with PHP 5.5 and it works fine. Now I want to upgrade PHP to version 5.6.6 my question is, is CodeIgniter compatible with PHP 5.6.6? I can't upgrade CodeIgniter to a new version because I have many models based on Version 2.2.6. 回答1: Codeigniter 2.2x IS COMPATIBLE with PHP7.1+. You only need to remember: Models/classes and so on are case-sensitive and have to start from capital letter The same with names of files in application folder There are problems with mysql

How to use composer packages in codeigniter?

社会主义新天地 提交于 2019-12-17 15:32:05
问题 I've followed this article: http://philsturgeon.co.uk/blog/2012/05/composer-with-codeigniter But I get Fatal error: Class 'Buzz\Browser' not found . What is missing from his post? My controller or application isn't namespaced. I was hoping to just be able to use that one package in one controller's action in a non-namespaced framework. 回答1: For CodeIgniter 3.x and composer, it's suggested to just set $config['composer_autoload'] to TRUE or a custom path in application/config/config.php . It

Extending The Controller Class in CodeIgniter

≯℡__Kan透↙ 提交于 2019-12-17 05:07:24
问题 I have class MY_Controller extends CI_Controller and common logic for big profile section, so I'va tried to create class Profile extends MY_Controller with common logic for profile section and all class related to this section should extends this Profile class as I understand right, but when I tried to create class Index extends Profile I recieve an error: Fatal error: Class 'Profile' not found CodeIgniter tries to find this class in index.php which I am running. Where is my mistake? Or maybe

cezPDF in Codeigniter 2

会有一股神秘感。 提交于 2019-12-14 04:07:25
问题 I am using cezPDF library in CodeIgniter 2 But it seems it can't print the table or ezTable isn't working properly Anyone faced this before? or any solution on that? take a look at my code here: $db_data [] = array ('name' => 'x' ); $db_data [] = array ('name' => 'y' ); $db_data [] = array ('name' => 'z' ); $col_names = array ('name' => 'col' ); $this->cezpdf->ezTable ( $db_data, $col_names, '', array ('width' => 180, 'xPos' => 140 ) ); 回答1: You are forgetting to write this instruction $this-

Codeigniter 2.1 $this->input->set_cookie($some_var); NOT WORKING

时间秒杀一切 提交于 2019-12-14 01:24:55
问题 I started creating a custom library that i would load for checking if user is logged in and also for registering users. Registration not started yet, but that's not important... here's the problematic part.. it WON't set cookies: $this->load->helper('cookie'); $some_value= 'asd'; $some_cookie_array = array( 'name' => 'some_name', 'value' => $some_value, 'expire' => 86500, 'secure' => TRUE ); $this->input->set_cookie($some_cookie_array); here is the full code for now: codepad.org/FILlq2qR This

Routes not working when uploaded to server (CodeIgniter)

℡╲_俬逩灬. 提交于 2019-12-14 00:34:55
问题 I created a site on CodeIgniter and everything works fine on XAMPP. But when I upload my file to the server the routes stopped working. I'm getting 404 URL not found error on all the page except the index page. here is my routes. $route['default_controller'] = "onlinec"; $route['404_override'] = ''; $route['home'] = 'serial/home/'; $route['done'] = 'serial/done/'; $route['redeem'] = 'serial/redeem/'; $route['printpage'] = 'serial/printpage/'; $route['login'] = 'serial/auth/login'; $route[

Css and Js files does not load in MVC CI

时光总嘲笑我的痴心妄想 提交于 2019-12-13 23:06:14
问题 Header.php <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="/Contents/css/bootstrap.min.css" rel="stylesheet"> <link href="/Contents/fonts/css/font-awesome.min.css" rel="stylesheet"> <link href="/Contents/css/animate.min.css" rel="stylesheet"> <link href="/Contents/css/custom.css