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