Good night everyone!
TypeError Argument 2 passed to CodeIgniter\Database\BaseBuilder::like() must be of the type string, null given, called in D:\xampp\htdocs\lordeCI\app\Controllers\AutocompleteSearch.php on line 31
Codeigniter is throwing this error for the chunk of code below, 'titulo' and 'post_id' are column names of a table called 'posts':
public function ajaxSearch()
{
helper(['form', 'url']);
$data = [];
$db = \Config\Database::connect();
$builder = $db->table('posts');
$query = $builder->like('titulo', $this->request->getVar('q')) //this is line 31
->select('post_id, titulo as text')
->limit(10)->get();
$data = $query->getResult();
echo json_encode($data);
}
Also, some images aren't loading properly, the browser gives a status code: 200 though content-type is "text/html", i've checked the image path and it is correct. However the message below showed up in dev tools, network tab.
"DevTools failed to load SourceMap: Could not load content for chrome-extension://pmncamalnkoafdfdmojmhanhngjaakcb/browser-polyfill.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME"