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



Search Forums

(Advanced Search)

Forum Statistics
» Members: 14,898
» Latest member: seatransport85
» Forum threads: 70,256
» Forum posts: 361,553

Full Statistics

Latest Threads
Forum: Addins
51 minutes ago
» Replies: 1   » Views: 39
Changing the name of a vi...
Forum: Model-View-Controller
55 minutes ago
» Replies: 1   » Views: 82
How to catch database ope...
Forum: Model-View-Controller
58 minutes ago
» Replies: 7   » Views: 231
Saving data to MYSQL
Forum: Model-View-Controller
1 hour ago
» Replies: 1   » Views: 30
Relations Module
Forum: CodeIgniter 4 Addins
3 hours ago
» Replies: 1   » Views: 346
Call function in model be...
Forum: CodeIgniter 4 Support
7 hours ago
» Replies: 0   » Views: 52
The requested URL was not...
Forum: Issues
7 hours ago
» Replies: 0   » Views: 38
Looking for a developer
Forum: Jobs
8 hours ago
» Replies: 15   » Views: 1,571
validation if_exist
Forum: CodeIgniter 4 Support
11 hours ago
» Replies: 0   » Views: 76
Basic App - Free CMS on C...
Forum: CodeIgniter 4 Addins
Today, 05:07 AM
» Replies: 26   » Views: 6,655

  Strange problem when connecting to external host using PDO
Posted by: Danielcik - 11-14-2019, 09:27 AM - Forum: CodeIgniter 3.x - No Replies


I have a big problem with my website. When I try to connect it to an external host, it gives me a strange error: 

PHP Code:
Severityerror --> ExceptionCall to a member function errorInfo() on bool /home/qtbflcqc/panel.unitchamp.ro/system/database/drivers/pdo/pdo_driver.php 295
 Unable to connect to the database 

When I try to connect to the database from my localhost, it works fine, without any problem. 

So, when I try to place the website on my PC, and connect it to the external host, it works perfect , no problem, no errors, but when I try to connect to it from the website (which is hosted), it gives me that error.

I set the Remote Acces from the external host, so there should be no problems.

Here is my database.php

PHP Code:
$active_group 'default';
$query_builder TRUE;

$db['default'] = array(
'dsn'   => 'mysql:host=188.x.x.x; dbname=name; charset=utf8;',
'hostname' => '188.x.x.x',
'username' => 'nameuser',
'password' => 'pass',
'database' => 'name',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => FALSE,
'cache_on' => FALSE,
'cachedir' => 'application/cache/',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE

Thans a lot!

  Help needed Multi city flight search logic
Posted by: msjagan - 11-14-2019, 04:05 AM - Forum: Lounge - Replies (4)

I would like to create flight booking system in CI4. I know the search logic for single and return way, but I couldn't figure out the logic for Multi city flight search like multi city search in expedia.com. 

I really appreciate, if anybody could help me to achieve multi city logic in PHP. 

  Passing key issue
Posted by: manigopal - 11-14-2019, 02:29 AM - Forum: General Help - Replies (4)

I am trying to pass a value and display datas based on it.

Like Passing a Genre Type and filtering movies based on that Genre alone.

The error which i get is

A Database Error Occurred
Error Number: 1054
Unknown column 'Action' in 'where clause'
SELECT * FROM `movies_info` WHERE find_in_set(Action,genre_info) > 0 LIMIT 24
Filename: C:/xampp/htdocs/ciprojects/showtime/system/database/DB_driver.php
Line Number: 691

Files at,
Model file @ https://gitlab.com/manigopal/ci-projects..._genre.php
Controller @ https://gitlab.com/manigopal/ci-projects..._genre.php
View @ https://gitlab.com/manigopal/ci-projects..._genre.php
SQL @ https://gitlab.com/manigopal/ci-projects...owtime.sql

Reference code i have used from,

Live at http:// cishowtime(dot)22web(dot)org/movies/genre/Action

  Automatic Database Migrations - Proposal
Posted by: loopzzz - 11-14-2019, 02:04 AM - Forum: CodeIgniter 4 Discussion - Replies (3)

Hello community, 
i had a few projects in Python/DJANGO and have seen some really useful stuff but one especially helpful

Database migrations generated automatically from the Models

i love CI and want to have all the good stuff in here as well to speed up development times


- table field definitions are in a single place (single source of truth) in the Model
- migration files are temporary
- you can delete all dev incremental migrations and recreate a final migration

i understand that this is a braking change for the CI updates but that's why i ask your opinions on this.

we already have the $allowedFields property defining the field names

i propose new property called $fields or similar describing the fields like in the migrations currently, this also needs clarification.

What are your thoughts ?

  Need help about IP Addresses
Posted by: SaraBailey - 11-14-2019, 01:07 AM - Forum: General Help - Replies (2)


I want to know the real IP address of the client accessing my app.  Why?
So I can compare it with my IP address.
I'm working on a web based desk top app and I do not want an employees logging in from anywhere other than physically in my office; unless an admin.

None of these below returns anything useful from behind LOCALHOST, it returns my own IP address as ::1 
Will I get a better result on a public host?  Is there a PHP.ini setting that I need to make?
Perhaps you have a better approach....

PHP Code:
   //ip from share internet
   //ip pass from proxy
    $ip $_SERVER['REMOTE_ADDR'];

Thank for help

  Open Source can survive in the Apocalypse
Posted by: php_rocs - 11-13-2019, 07:08 PM - Forum: Lounge - Replies (1)

Interesting read on twitter... https://twitter.com/i/moments/1194639035517587456

About open source surviving the apocalypse.

  CI4 RC3 - How to access css file in vendor directory
Posted by: elyday - 11-13-2019, 03:14 PM - Forum: Model-View-Controller - Replies (3)


I started building views for my CI4 project today. This directly encounters my first problem:
I installed Bootstrap via Composer and wanted to access its css file in my view, which didn't work (which makes sense in itself).

Is it possible to access the vendor folder and its CSS files from the view or do I always have to copy the CSS files into public/ folders?

Best regards

  How to catch database operation errors
Posted by: _Alain_ - 11-13-2019, 01:39 PM - Forum: Model-View-Controller - Replies (7)


I try to catch an error if something with the database operations goes wrong.
I tried many variants of the following code but $data always returns true (it doesn't matter if the database operation produces an error or not).

What do I have to do to catch an error if database operation went wrong?


PHP Code:
class Users_model extends CI_Model {
    public function deleteUser($userID)
$result $this->db->delete('users');

PHP Code:
class Users extends CI_Controller {


    public  function deleteUser()
$userID $this->input->post('user_id');
        $data $this->users_model->deleteUser($userID);

View (see the "<" for var user_id. This should generate an error because the user with such an id cannot be found)
PHP Code:
            // Delete user button
            $('.btn-delete-user').on('click', function(){
                var user_id                "<" + $(this).data("id");
                    type "POST",
                    url  "<?php echo site_url('users/deleteUser')?>",
                    dataType "JSON",
                    data : {user_id:user_id},
                    success: function(data){
                    error : function() {
                        alert("Some error happened");
                return false;

Kind regards

  Seo url and multilanguage
Posted by: togrul614 - 11-13-2019, 01:16 PM - Forum: Best Practices - Replies (2)


I have a problem with routing. I have a website in 3 languages, AZ, EN, RU. And I have dynamic pages created from admin. So I have 3 page domain/about, domain/en/about, domain/ru/about. Every slug is different depend on language. So I have another domain/jobs/etc , domain/en/jobs/etc/. and it continues like this. 

How I can do this routing like WordPress?

  Move away content from public_html in a git repo on live server
Posted by: muuucho - 11-13-2019, 08:39 AM - Forum: General Help - Replies (5)

I get the security thing about moving content away from public_html/. 
My workflow is that I push from my local machine to GitHub and to my live server. 
Yes, I can change the structure on my live server (like moving certain content up one level), but I guess I must keep it on my local machine. 
How do I push to my live server after having moved content up one level?

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