Hello,
I have an issue with datagrid when uing a query with a JOIN on 2 tables that have a same column name.
The grid work, but the search filter on the column that is in the 2 tables return an ambigous sql error
using alias does not really help…
here is the query:
SELECT
DISTINCT (cc.CCid),
DATE_FORMAT(cc.CCdate, “%d/%m/%Y”) AS CCdatemod,
cc.CCstatus,
cc.Custfax,
CCinvestigator,
cc.Salesrep,
CP.Pname,
“Edit” as edit_link,
cc.CCid as pdf_link
FROM cc
JOIN cc_products CP ON (cc.CCid= CP.CCid)
GROUP BY cc.CCid
CCid is the column causing problem in search.
A tip to fix this?
Thanks,
Cedric
2 Answers
You need to specify table.field to resolve ambiguity.
$col["dbname"] = "cc.CCid";
Your Answer