![]() |
Hi,
I cannot get my alias to work so that I can join other tables rather than running multiple queries at once. PHP Code: error: Please see code below: PHP Code: $builder = $this->db->table($this->tables_alias['logs']) PHP Code: public array $tables_alias = [
It seems table() only takes the table name and adds a prefix.
That's why you see the error. If so important, try removing the prefix for the query. Perhaps there is another option https://codeigniter4.github.io/userguide...-setprefix
"flare_" prefix. He auto concat with table
Looks like I can’t see the code on my phone. Can’t really tell why a table alias is necessary to create a join.
QueryBuilder's table name supports an alias.
Quote:@param array|string $tableName tablename or tablenames with or without aliases See https://github.com/codeigniter4/CodeIgni...#L295-L304 (09-06-2023, 10:12 AM)ozornick Wrote: It seems table() only takes the table name and adds a prefix. Apperciate it. The prefix was causing the issue so I've just removed it. |
Welcome Guest, Not a member yet? Register Sign In |