Welcome Guest, Not a member yet? Register   Sign In
db start_cache and table alias name
#1

[eluser]Unknown[/eluser]
Hi,
I have a problem with db->start_cache and table's alias.

If without cache, there will be no problem however with cache, any alias will appended by the global table's prefix and throws out an error. I have to use the full name to avoid this issue and let's just say its annoying since a lot of table's name are rather long.

Here are some codes and errors
Code:
// set basic information to be selected
$this->db->start_cache();
$this->db->select('jobapp.*,status.name AS statusname,status.id AS statusid')
         ->from('jobapp')
         ->join('jobapp_status AS status', 'jobapp.status = status.id')
         ->order_by('jobapp.fullname','ASC');
Code:
A Database Error Occurred

Error Number: 1054

Unknown column 'slgrspn_status.name' in 'field list'

SELECT `slgrspn_jobapp`.*, `slgrspn_status`.`name` AS statusname, `slgrspn_status`.`id` AS statusid FROM (`slgrspn_jobapp`) JOIN `slgrspn_jobapp_status` AS status ON `slgrspn_jobapp`.`status` = `status`.`id` ORDER BY `slgrspn_jobapp`.`fullname` ASC LIMIT 20

Filename: C:\site\includes\system\database\DB_driver.php

Line Number: 330
#2

[eluser]Unknown[/eluser]
no one here?




Theme © iAndrew 2016 - Forum software by © MyBB