Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,730
» Latest member: kmd
» Forum threads: 67,380
» Forum posts: 421,418

Full Statistics

Latest Threads
DBFORGE add field zerofil...
Forum: General Help
9 hours ago
» Replies: 2   » Views: 84
CSRF problem issue
Forum: General Help
9 hours ago
» Replies: 2   » Views: 66
How to show data only his...
Forum: General Help
10 hours ago
» Replies: 2   » Views: 125
is there a way to get mor...
Forum: CodeIgniter 3.x
Today, 06:51 AM
» Replies: 1   » Views: 97
Connect to remote databas...
Forum: General Help
Today, 06:46 AM
» Replies: 1   » Views: 64
form_validation.php in co...
Forum: General Help
Today, 03:59 AM
» Replies: 10   » Views: 366
Looking for an experience...
Forum: Jobs
Today, 01:16 AM
» Replies: 4   » Views: 1,545
Is there a way to combine...
Forum: General Help
Yesterday, 11:29 PM
» Replies: 5   » Views: 165
Forum: CodeIgniter 4 Support
Yesterday, 08:05 PM
» Replies: 0   » Views: 65
Migration to new hosting ...
Forum: Installation & Setup
Yesterday, 10:56 AM
» Replies: 0   » Views: 85

  CSRF problem issue
Posted by: sidd89 - Today, 04:49 AM - Forum: General Help - Replies (2)

I am having a problem with csrf protection... I want to use it only in index page for login but after making the csrf config true it gives me error "action not allowed". How to remove other pages from csrf protection if i am using routing.??

Please anyone help me out

  Connect to remote database in phpstorm
Posted by: omid_student - Today, 03:20 AM - Forum: General Help - Replies (1)

Hello guys
I use codeigniter in phpstorm noooooow Heart
I need connect to my host database remotely but i dont know how do use it

Thumbs Down application/Views/errors/html/error_exception.php
Posted by: donpwinston - Yesterday, 08:05 PM - Forum: CodeIgniter 4 Support - No Replies

In my Eclipse IDE application/Views/errors/html/error_exception.php is getting flagged as an error(2) because of a reference to \CodeIgniter\Services::request(null, true).

Shouldn't it be \Config\Services::request(null, true)   \Config\Services::response(null, true) ?

  How to show data only his data while he login
Posted by: kelapamuda - Yesterday, 12:18 PM - Forum: General Help - Replies (2)

Hi everyone, 
The condition is employee login by using email as username, and after login all employess data are shown in the table. But the condition  i want is this: when an employee login, he only could see his data only.

The condition now is :


It will show up all data,,so i modified it by adding this line

But no data shown up in the table, how to fix this? 

I am sorry , i already google but still confuse, i think this is about getting record by session, any help will be very usefull since  i am a beginner, thanks.

  Migration to new hosting with postgreDB
Posted by: sivaki - Yesterday, 10:56 AM - Forum: Installation & Setup - No Replies


I'm looking for help with migration of my website where I using codeigniter. I migrated website to another hosting and on the new hosting is postgreDB.

Everything was ok with migration, but after web running on new hosting with postgreDB I tryed to login to administration in web application and there was the issue. 

I'm not able to  login into my administration. Access data and request are ok, but I getting back bad response (incorrect credential).
I'm currently using version 3.0.6 codeigniter.

This is my setup of DB in config/database.php

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'    => '',
    'hostname' => 'xxx',
    'username' => 'xxxx',
    'password' => 'xxxx',
    'database' => 'xxx',
    'dbdriver' => 'postgre',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE

Can you please help me anyone?

Thank you,


  is there a way to get more metadata
Posted by: vishok - Yesterday, 10:24 AM - Forum: CodeIgniter 3.x - Replies (1)

according to documentation the only metadata we can get with this "$fields = $this->db->field_data('table_name');"
are $field->name; $field->type;$field->max_length;$field->primary_key; but is there a way to check if a field is required or a foreign key?


  How to handle DECLARE and SET in MS SQL query with ODBC driver?
Posted by: 90zlaya - Yesterday, 09:07 AM - Forum: General Help - No Replies

Hello everyone! I have problem running MS SQL queries in CodeIgniter.

If we have query like this:

PHP Code:
$return '';

  $query "
       DECLARE @number int
       DECLARE @name varchar(10)

       SET @number = 1000
       SET @name = 'nothing'
       SELECT @number AS one_thousand, @name AS nothing
  $result $this->mssql_connect->query($query);
  $sql $result->result_array();
  foreach ($sql as $row)
      $return .= $row['one_thousand'];
      $return .= ' ';
      $return .= $row['nothing'];
      $return .= '<br/>';
return $return

Following error occurs:

Quote:   odbc_fetch_array(): No tuples available at this result index

Do I have special methods for ODBC type queries? My current fix for this problem is to split query string and insert PHP variable, which is ugly and requires a lot of work in form of redefinition of existing queries.

  DBFORGE add field zerofill
Posted by: flav - Yesterday, 03:52 AM - Forum: General Help - Replies (2)


I would like to create a table with a field tinyint(2) unsigned zerofill. When I try the statement below column is created but zerofill don't work. 

'month' => array(
                    'type' => 'TINYINT',
                    'constraint' => '2',
                    'unsigned' => TRUE,
                    'zerofill' => TRUE)

Do you have the solution ? Is my syntax correct ?


  Is there a way to combine these two functions? Category System
Posted by: kirasiris - 02-15-2018, 06:15 PM - Forum: General Help - Replies (5)

Hi, I'm working on a blog in which I need to display the categories it has, the problem is not that I can not get them, the problem is that I have to select the two values(category.id and category.title) in my add view , basically I have two inputs and I'm trying to get them together in just one single select input.

Here is my functions, one for selecting the ID of the category, and a second one for the category's name.

PHP Code:
    // Select Category ID
           $subject_options = array();
           $subject_options[0] = 'Select Post Category ID';

           $subject_list $this->Posts_categories_model->get_list();
$subject_list as $subject){
               $subject_options[$subject->id] = $subject->title;                                

           $data['subject_options'] = $subject_options;
// Select Category Name
           $subject_name_options = array();
           $subject_name_options[0] = 'Select Post Category Name';

           $subject_name_list $this->Posts_categories_model->get_list();

           foreach ($subject_name_list as $subject_name) {
               $subject_name_options[$subject_name->title] = $subject_name->title;

           $data['subject_name_options'] = $subject_name_options

Here is my method get_list located in the Post_categories_model:

PHP Code:
   public function get_list()
       $query $this->db->get($this->table);
       return $query->result();

This is what I have in my add view:

PHP Code:
   <!-- Post Subject ID -->
div class="form-group">
form_label('Post Category''subject_id'); ?>
        <?= form_dropdown('subject_id',$subject_options,0, array('class' => 'form-control')); ?>
    <!-- Post Subject Name -->
    <div class="form-group">
        <?= form_label('Post Category Name''subject_name'); ?>
        <?= form_dropdown('subject_name',$subject_name_options,0, array('class' => 'form-control')); ?>

and there's another problem, when displaying the category name in my post view(index.php; see below), I have this:

PHP Code:
<class="fa fa-folder-open"></i> <a href="<?= base_url(); ?>posts/category/<?= $page->subject_id; ?>"><?= $page->subject_name?></a> 

it seems pretty simple but what can I do if there's more than one category per post?

I hope you guys can help me.

By the way this is what I have in my controller to display the posts:

PHP Code:
   public function index()
// Get Posts
       $data['posts'] = $this->Post_model->get_featured();
// Get Post Categories
$data['categories'] = $this->Post_model->get_categories();
       // Load template

  CodeIgniter 3 With IIS 7.5 - Best Code for File Downloads
Posted by: cgtrman - 02-15-2018, 03:40 PM - Forum: General Help - No Replies

I am relatively new to CI. I have a working site with basic login/logout code in place.  I store the user's userid in a session. My next task is to provide a download link for each file listed in the database (files are stored outside of the webroot). I am not a newbie to PHP but not an expert either. I am looking for a solution that is easy to understand and contains the basic code.  

Here are the parameters for downloading files on my site. 

  • IIS 7.5 Web server
  • PHP 7
  • CodeIgniter 3
  • Files stored outside of webroot
  • Only logged in users can download files
  • No file path information will be stored in the database
  • Content types will be images, MS Office docs, PDFs, mp3, mp4
Any recommendations are greatly appreciated.

I've seen this solution, but it is only for downloading files residing within the webroot: http://www.technicalkeeda.com/codeignite...ad-example

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.