if you got this error message, try double check if you have ever joined any table grades to itself, there is an example:
select * from `a_branches`it joined the table "a_branches" to itself.
left join `a_branches` on `a_branches`.`agency_ref` = `a_agencies`.`agency_id`
left join `ab_addresses` on `a_branches`.`branch_id` = `ab_addresses`.`branch_ref`
where `a_branches`.`branch_id` = 8
The solution is edit that tables name:
select * from `a_agencies`
left join `a_branches` on `a_branches`.`agency_ref` = `a_agencies`.`agency_id`
left join `ab_addresses` on `a_branches`.`branch_id` = `ab_addresses`.`branch_ref`
where `a_branches`.`branch_id` = 8
Reference:
http://stackoverflow.com/questions/2077355/mysql-php-not-unique-table-alias
No comments :
Post a Comment