0

I'm stuck with CI4, I tried checking whether something similar to the input data in database table. but it always shows the above error.

my controller code is

                $source = $this->request->getVar('source');
                print_r($source);
                $destination = $this->request->getVar('destination');
                print_r($destination);

                $model = new BusModel();
                $src_data = $model->getSource($source);
                print_r($src_data);

it works up to printing destination then the CodeIgniter shows errors as shown in the title. Model has the following code

class BusModel extends Model 
{
    protected $table = 'stop_times';

    public function getSource($source)
    {
        if (!empty($source)) {

        $db = \Config\Database::connect();
        // $db = db_connect();
        $builder = $db->table('stop_times');
        $builder->select('stop_sequence, arrival_time');
        // $builder->from('stop_times');
        $query = $builder->getWhere(['stop_id' => $source]);
        print_r($query);
        }

I tried different methods but it always shows the same error

shabi
  • 5
  • 3
  • Does this answer your question? [Codeigniter: fatal error call to undefined function mysqli\_init()](https://stackoverflow.com/questions/33612956/codeigniter-fatal-error-call-to-undefined-function-mysqli-init) – Dharman Jun 18 '20 at 11:03
  • I do have a Codeigniter 3 application working perfectly fine on the one end. So, I think it's different even though I haven't tried it – shabi Jun 18 '20 at 11:25

0 Answers0