random color creation without change when refreshing the page

get data list from the database: foreach ($rowset as $key => $value) { $colorrange=str_split($value->id); $findend=end($colorrange); $response[$key]['color'] = $this->get_color($findend); } function to get color: public function get_color($finden

How to connect with MongoDB via CodeIgniter

I am upgrading my Ubuntu server and installing latest version of PHP i.e PHP 7.0.18, MongoDB 3.2.14, CodeIgniter v 2.2. Now when I am trying to connect with Mongo through CodeIgniter I am getting error as: The MongoDB PECL extension has not been inst

How to use where condition in the update batch in Codeigniter

I want to update a multiple row using $this->db->update_batch('mytable', $data); But Don't Know How to give condition in this update_batch. Can I use this where? $this->db->where('id', Multiple Ids Here); i have code that is different from you

Removing the breadcrumb UID from CodeIgniter

I made breadcums automatically on CodeIgniter but, on the user profile editing view, my uuid is shown as uri->segment. I think It will look cleaner without the uuid. How can I skip, delete or hide it? MY url http://localhost/myproject/user/edit/00040

Best practice for printing barcodes in dompdf

I want to create a label sticker with barcode in PDF. Please give me the suggestion to create this things. Now , I use CI3 and dompdf. I have tried googling a lot of time, but I am not found the best practice to realized this thing. I followed your s

Error getting a CODEIGNITER array output

am doing this thing to get the values of the database, i am using this all the time but now i am getting this error. this one is working on every module i made but isnt working on my module, why is it? the error is, Severity: Notice Message: Trying t

Simple PHP array codeigniter controller

I would like to shorten my CodeIgniter controller a bit. Now it looks like this: case 'klant1': $data['title'] = $page; $this->load->view('templates/header', $data); $this->load->view('pages/klant1', $data); $this->load->view('templates/

Codeigniter SUM and LEFT JOIN when deleting duplicates

I am left joining 4 tables to get SUM of the amount that is present in first table. So far, I've tried many alternatives to get the sum straight, but either it becomes 0 (if I group_by), or duplicates, if I don't use group_by. here is my code: $this-

Memory size error allowed in the Tbs library

Hello i am facing the problem of Allowed memory size error. I have created the project in codeigniter, php and I have used Tbs library. Its worked fine but today it display the error: Fatal error: Allowed memory size of 67108864 bytes exhausted (trie

can not connect to DB codeIgniter

I'm new to codeIgnitor and I'm trying to learn it by myself. but when I followed the specific instruction from this tutorial [http://www.codeigniter.com/user_guide/tutorial/news_section.html][1] this is my DB config $db['default'] = array( 'dsn' => '

Run multiple subfolder Web sites in a separate folder

I have a main website (example.com). I use CodeIgniter framework there. I will also use some different subfolders like example.com/sub1, example.com/sub2. I am using Laravel framework here and those will be completely different from example.com and s

Can not delete user in codeigniter

I can not delete user in codeigniter, When i click link to delete, it not working. It's a series on tutlus: Build a CMS in CodeIgniter. link delete: /admin/user/delete/3 Controller: class User extends Admin_Controller{ public function __construct() {

Join tables with different field names using Grocery CRUD

I have the below tables CREATE TABLE IF NOT EXISTS `maintrequests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `propID` int(11) DEFAULT NULL, `landlordID` int(11) NOT NULL, `subject` varchar(45) DEFAULT NULL, `message` varchar(200) DEFAULT NULL, `status`

call the controller method in href in a button, in a view

iam back with another question to do with mvc and codeigniter. just getting a bit confused with the concept of MVC. First of all i have a button. i want it to reference another page. how i was going to access the next "view" or page was from thi

Logout in codeigniter

I am trying to design a login/logout page in codeigniter framework.My problem is that when I logout of the web-page I am getting redirected to a login page. When I go back I am getting a page which says: Document Expired This document is no longer av

get the parent ID of the parent div using jquery

I have the following code and I need to have the id of the post in jquery! please help me in this. foreach($posts->result() as $post){ echo "<div class='post' id='$post->id' >"; echo $post->content; echo "<div class='comme

Captcha using codeigniter does not work

I am trying to implement captcha functionality using codeigniter. But it is not displaying captcha images. Here is my code : //Controller file : captcha.php <?php class Captcha extends CI_Controller { var $controller = "captcha"; var $viewCon

The Ajax call is not given in the codeigniter

<script type="text/javascript" language='javascript'> $('#view_comment').submit(function() { alert("msg"); var sec={'post_id_for_view_comment' : $("#post_id_for_view_comment").val()} $.ajax({ url: "<?php echo ba

Codeigniter removes characters from HTML Email

I have developed a CMS and when user forgets his/her password / the system will generate a new random password and send it to the user through email but when i open the email it automatically strip some character from my email body replacing them wit

Create a folder and upload images in php / codeigniter

I have a simple image upload form on my website where users can upload multiple images at once. I want to have my images organized in folder based on the month and year in the following format: MONTH-YEAR, so each time new upload starts I first check

Codeigniter date-compare database

Im having a problem comparing dates in a database to a week from now using activerecord. I'm trying to return a list of events with their start date less than a week from now. The event_start_date is in the format of 2011-06-30 09:00:00 $this->db->s

CodeIgniter Authentication Library 2011

I am looking for a flexible, easy customized, Userlevel access and secure Authentication library that I can quickly get started with. I was looking at Stackoverflow and read about a few Authentication libraries but these posts were posted in 2010. Wh

Using wildcards in CodeIgniter

Wildcards are cool. I am trying to do this: $route["(:any)/controller"] = "controller"; basically, I want to put the wildcard in the front. It doesn't quite work, and I don't know any work around.Should work. If it doesn't try shufflin