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

2
  • Does this answer your question? Codeigniter: fatal error call to undefined function mysqli_init() Commented Jun 18, 2020 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 Commented Jun 18, 2020 at 11:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.