codeigniter

Connecting codeigniter to mysql and oracle in the same application

被刻印的时光 ゝ 提交于 2019-12-22 11:34:00
问题 I'm using Mysql and Oracle for my CI application. I tried to connect it but I found that I cannot make a query to Oracle database. It always gave an error that the table is not exist. I already set the database.php to something like this $active_group = 'oracle'; $active_record = true; $db['oracle']['hostname'] = '10.10.10.1:1521/ocidb'; $db['oracle']['username'] = 'ociuser'; $db['oracle']['password'] = 'ocipass'; $db['oracle']['database'] = 'ocidb'; $db['oracle']['dbdriver'] = 'oci8'; $db[

Form Helper: Any other benefit?

坚强是说给别人听的谎言 提交于 2019-12-22 11:31:59
问题 I am new to codeigniter and I have just created a test login system. Chuffed... I would like to make a form for this login system as I have just been passing the username/password directly for testing. I am trying to work out the benefits of using the form helper. It helps me contsruct a form easily but can I not do this in just pure html? Is there another benefit of the form helper - I am just talking about the part that creates the form and not the validation - I am guessing I can use the

ng-file-upload not uploading in Ionics

℡╲_俬逩灬. 提交于 2019-12-22 11:19:33
问题 I am using ng-file-upload library for my Ionic mobile application and Im having challenges in implementing this library. I also used Codeigniter for my REST API. My upload request should have fields(some data) and the images. here is my code so far: $scope.doSubmitAttachment = function(){ console.log('@@@@@doSubmitAttachement- Process Request--' + $scope.images); $scope.upload($scope.images); }; $scope.upload = function (file) { Upload.upload({ url: 'http://192.168.8.247:130/api/upload',

Codeigniter one service with multiple access points, subdomains, htaccess

依然范特西╮ 提交于 2019-12-22 11:15:48
问题 I am not exactly sure how to word this properly so I apologize in advance. I have a slightly unique setup, but at the same time not so unique. I want to have api.domain.com m.domain.com domain.com All working off the same codebase, but serving up different views, and working off different controller sets. However I do not want to duplicate my code base by making mirror copies of it in various directories specific to the sub domain itself. To me that is redundant, and the opposite of

Fetch event details (title, start and end) from database for fullcalendar

旧时模样 提交于 2019-12-22 11:11:14
问题 I have really searched a lot about this, but I still haven't gotten through with my problem. I am creating a calendar (using the plugin fullcalendar and using codeigniter as the backend) that would display a tour and it's specific time span. So, in this case the title of the event would be the tour name, and for the duration of the tour, the start and end dates is to be fetched. I have already succeeded with the insertion of the data to the database, it's just that the events are not

Multiple Queries in Codeigniter [duplicate]

十年热恋 提交于 2019-12-22 11:02:54
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: MYSQL multiple insert in codeigniter I would like to execute multiple insert queries simultaneously using codeignitor framework in PHP.There is any simple ways to do this without writing multiple insert queries.Already tried something like $this->db->query('INSERT INTO students (first_name, last_name) VALUES ('teejay', 'obazee')' ('maev', 'shadowsong')' ('jaina', 'proudmore')', FALSE) .There is any ways like

join 3 tables in mysql codeigniter

一笑奈何 提交于 2019-12-22 10:59:14
问题 I have 3 tables in my database :- tbl_roles(role_id,role_name); tbl_users(id,role_id,username,email,password); tbl_tickets_replies(id,ticket_id,user_id,role_id,comments) role_id, id, id are primary keys of corresponding tables. i need :- username from tbl_users. role_name from tbl_roles. comments from tbl_tickets where ticket_id from tbl_tickets_replies = $ticket_id coming as a parameter. My Model Function is :- function fetch_comments($ticket_id){ $this->db->select('tbl_tickets_replies

code igniter load library from within library?

孤街浪徒 提交于 2019-12-22 10:54:38
问题 Is it possible to load an library from within a library in code igniter? If I do $this->validator = $this->CI->load->library('validators/'.$params['validator']); from within another library $this->validator is NULL. Why would this be? 回答1: Check out the CI_Loader class's signature for the library() method you refer to: /** * Class Loader * * This function lets users load and instantiate classes. * It is designed to be called from a user's app controllers. * * @access public * @param string

How do you remove a leading newline in output to browser in Codeigniter

跟風遠走 提交于 2019-12-22 10:45:15
问题 I have been having issues with a newline appearing in my browser output with Codeigniter. What happens is I am outputting JSON data, but there is a newline character before any of the JSON data, and it is messing stuff up. 回答1: Likely you have some whitespace at the end of one of your PHP files. It is a pretty common problem if you use the closing tag ?> . You'll want to search your code files and look for a ?> with a newline character after it. Anything after a closing tag gets output to the

Codeigniter: User session keeps expiring

邮差的信 提交于 2019-12-22 10:33:08
问题 I'm using CodeIgniter, and I'm having a small issue with sessions. I've set 'sess_expiration' in config.php to 0 so that the user session will never expire, yet users -even myself- are still occasionally kicked out and asked to login again! (i'm storing sessions in the DB btw) The way I validate a user's session is by basically checking if user_id (which I've previously stored in the session is TRUE or FALSE. If it's FALSE then it asks them to login again. Any idea what could be forcing