Codeigniter 2.2.6 find the min value of the sql column

I have an error: Array to string conversion In my model I have this: public function get_min(){ $this->db->select_min('sq_place'); $query = $this->db->get('places'); return $query->result(); } In my dump data I got this: array (size=1) 0 =&

How to hide a submission button in codeigniter

How to hide the submit button when $row['completion_status']=='completed'. My view code is: <input type="submit" <?=($row[ 'checklist_id']=="Denied" ||$row[ 'checklist_id']=="Approved" ||$row[ 'completion_status']==&quo

Ion Auth and Bootstrap Modals

I want to integrate Ion Auth into my bootstrap login which is a modal, I'm using Code Igniter. How do I call Ion Auth's Login method when the login button is clicked? If I use redirect won't it reload the page and remove the modal? Can I call the con

Codeigniter - checks if the value is unique

I am trying to check if value is unique. I have the function, but how can I check it again. This is the function (it is working): public function is_unique($field, $val) { $this->db->select($field)->where($field, $val); $result = $this->get();

Codeigniter pagination does not work properly with db query

I'm not getting success in integrating paging with the result of my select with codeigniter. I'm starting to work with codeigniter and I am unable to make a pagination correctly. The links are created correctly, they put no limits, and the links do n

What data do I need to store in a PHP session?

I am building a small application that users can log into using CodeIgniter My question is, when a user logs in, is it advisable to store a lot of the users personal information in the session (like their user id, name, email and telephone number). O

Executing controller methods from a library in codeigniter

i have a question, i am developing a library for Codeigniter to create Job Queues with workers and delayed queue (Codeigniter-JobQueue). But i have a question... ... How can i perform or execute controller's methods inside this library? It will be aw

Avatars CodeIgniter download

Here's the new HTML: <input type="file" name="file_1" /> <input type="text" name="image_description_1" class="text-input"/> Here's the new _submit function: if($this->CI->input->post('

Change the CodeIgniter controller directory based on the URL

I'm new to CodeIgniter and I have to make a mobile website which will be on a subdomain. The only different thing to be loaded depending if you are mobile or not would be the controllers directory, all the rest of the application folder is fine for b

Creating Codeigniter URLs with Variable Segments

I have searched for the solution to my problem in CI user guide and on Stackoverflow as well but couldn't find. So, here is my problem. I need to build SEO friendly URLs. I have a controller called "Outlets" and the view that I need to generate

Dropdown Select: Displaying Category Names with Elements

I am populating a dropdown select from my database. The dropdown select that I have managed to create so far contains some names of products only. I want to display the category names along with the products, but the category names should not be sele

CodeIgniter: current_url displays a question mark

Say my page is on: http://localhost/app1/profile/index/123/ The result of current_url() is this: http://localhost/app1/?profile/index/123 There is a ? that shouldn't be there. The question mark seems to be caused by the following config setting: $con

Deleting database records using jQuery AJAX does not work

I am trying to delete records from database without reloading the page. In the view file I have the following code. But when I click on the delete link nothing happens. Would you please kindly help me find out where I have done wrong? Thanks in advan

Extensible Code Extensible System?

I am writing a authentication Library for Code Igniter (for practice, so please do not suggest e.g. Tank Auth or DX Auth). The library has basic login functionality, it also has the ability for Facebook and Twitter Logins. However the Facebook and Tw

CodeIgniter - modular?

I'm building several sites that need similar "modules." For example, the sites may have the exact same login system, forum, etc. Is there a way I could build these modules once and just "drop" them in these various sites? Some of the c

CodeIgniter: Validate the form with multidimensional POST data

So the framework is CodeIgniter 2.0.2. I have a form that has groups of fields that correspond to rows in a database. The names of the fields are in the format: opt[0][foo] opt[0][bar] opt[1][foo] opt[1][bar] etc... The index (1,2,etc...) does not co

CodeIgniter and autoloading the database library

I've got an issue connecting to the database with CodeIgniter. In the model, if I do $this->load->database(); then a query such as $query = $this->db->get('articles', 10); works and returns data. However, when I remove the load->database li