Questions tagged [codeigniter-2]

CodeIgniter 2.x is an old and no longer supported version of the popular PHP framework. Please refer to the [codeigniter] tag for more information.

Codeigniter 2.x is an old and no longer supported version of the popular PHP framework.

The last 2.x version (2.2.6) was released on October 31st, 2015, which is also the date when security maintenance support for the 2.x version tree was officially ended.

For more up-to-date information on the Codeigniter framework, please refer to the tag.

Links:

3146 questions
20
votes
5 answers

Extending The Controller Class in CodeIgniter

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…
Yekver
  • 4,985
  • 7
  • 32
  • 49
20
votes
2 answers

Has CodeIgniter 2.0 / PHPUnit happened yet?

So i've just had a pretty disappointing morning/weekend. It came in the form of setting up PHPUnit, Integrating Eclipse etc Now i've just discovered that there's no straightforward way to test CodeIgniter 2.0 applications directly from PHPUnit. I've…
jim
  • 8,670
  • 15
  • 78
  • 149
19
votes
4 answers

CodeIgniter 2.1 issue with show_404() and 404_override

I have been working with CodeIgniter for quite a while now and I'm currently doing a project for a client that would like a custom 404 page. Everything is fine and the 404_override it works great. My issue comes when a visitor is trying to access a…
Casper O
  • 252
  • 1
  • 2
  • 9
18
votes
4 answers

How to show validation errors using redirect in codeigniter?

I have been dealing with a problem for a while. How can I set the validation errors using redirect in a function? This is the code I have in my controller : function send() { $this->form_validation->set_rules('e-mail', 'Email',…
Afshin
  • 2,427
  • 5
  • 36
  • 56
18
votes
5 answers

Using Mysql WHERE IN clause in codeigniter

I have the following mysql query. Could you please tell me how to write the same query in Codeigniter's way ? SELECT * FROM myTable WHERE trans_id IN ( SELECT trans_id FROM myTable WHERE code='B') AND code!='B'
black_belt
  • 6,601
  • 36
  • 121
  • 185
17
votes
2 answers

Under Codeigniter, is it possible to see mysql_error()?

I have an Codeigniter app (using version 2.1.0) that is writing a transaction to a mysql database. I'm fairly sure that I've got a foreign key constraint error occurring, but I can find no way to make CI tell me the specific error. mysql_error()…
pbarney
  • 2,529
  • 4
  • 35
  • 49
17
votes
5 answers

CodeIgniter Passing POST data from RestClient to RestServer API

I've spent my whole day trying to figure out this problem. Posting this issue here is my last hope. I hope someone can help to continue working on my first job. So, POST works fine when directly passing data from my views to the RestServer directly.…
16
votes
4 answers

Codeigniter - Batch Update with Multiple Where Conditions

For starters, the Codeigniter documentation on update_batch does not exist. kenjis was kind enough to provide some documentation and submit it to the repository. Hopefully they pull it soon. Does anyone know how to add multiple where conditions to…
zechdc
  • 3,374
  • 9
  • 40
  • 52
16
votes
1 answer

PHP Error encountered when running Command Line using CodeIgniter 2.xx

I have followed the exact guide that is provided on the official codeigniter website for running the CLI (command-line interface) tool. https://www.codeigniter.com/userguide2/general/cli.html My controller is...
Zabs
  • 13,852
  • 45
  • 173
  • 297
16
votes
1 answer

Can I pass data to the Codeigniter output class without displaying it?

I'm working on a way for users to be able to generate PDF copies of invoices and other tabular data. To do this, I've wrapped dompdf into a library that I can use with CI and created a method that will generate a PDF based on the return value of…
Tim Post
  • 33,371
  • 15
  • 110
  • 174
15
votes
5 answers

Codeigniter echoing [::1] instead of localhost

I am using CodeIgniter 3 as a web platform and trying to import semantic-UI CSS into my page. I'm doing so by using CodeIgniter's base_url() method in the href property for the CSS import. However, semantic.css itself imports some other fonts on my…
Dalannar
  • 381
  • 1
  • 2
  • 11
14
votes
5 answers

CodeIgniter update query gets executed twice

I am using CodeIgniter 2.2. I have to update database with +1 every time a page is visited. Code works but it get incremented by +2 every time. Example: if total views=2, once the page is clicked total views should be 3, but the value in the…
Sathya Baman
  • 3,424
  • 7
  • 44
  • 77
14
votes
6 answers

how to pass a variable from one controller to the other in Code igniter

I have just started learning Code Igniter . I want to know how can I pass a variable from one controller(first_cont.php) to other controller (second_cont.php) ? Any help would be appreciated . Thanks in Advance :)
WomenInTech
  • 1,141
  • 2
  • 18
  • 25
14
votes
3 answers

Reports in Codeigniter

What is the most simplist way to generate reports in Codeigniter framework? Is there any library available to do this task? Except charting what are the other resources to do this.
Muhammad Raheel
  • 19,823
  • 7
  • 67
  • 103
13
votes
1 answer

Is there a function like _compile_select or get_compiled_select()?

Looks like _compile_select is deprecated and get_compiled_select is not added to 2.1.0. Are there any other functions like those two? And also I am curious. Is there any particular reason to not adding get_compiled_select() to Active Record and…
mirza
  • 5,685
  • 10
  • 43
  • 73