Hello:
I have a situation where I have a main table with two references to another table.
I have a query similar to this:
SELECT client1.name AS name1, client2.name AS name2, sen_main.moredata FROM sen_client AS client1, sen_client AS client2, sen_main WHERE idclient1 = client1.idclient AND idclient2 = client2.idclient
When I call the grid, only the first column is populated. I tried different combinations, adding more columns, one with and another without alias, and the result is always the same, only the first reference is shown, the second reference is always left blank.
Can someone tell me the way I need to write my query so that it will populate both columns?
Thanks in advance.
Hello,
Please make sure you set column name as alias OR field name if alias is not used.
// for col1
$col["name"] = "name1";
…
//for col2
$col["name"] = "name2";
…
Also try running your query on sql ide e.g. phpmyadmin to verify if it is returning data.
If still not resolved, please post your code. You can use pastebin.com for sharing.