I got a query that joined some tables together, some have identical names, for example id is twice in the result, and when I try to echo the id, it displays the wrong one.
How can I solve that?
My query:
$content = "
SELECT ct.*
, fe.*
, cn.*
FROM web_content ct
JOIN web_fieldsandfilters_elements fe
ON fe.item_id = ct.id
JOIN web_fieldsandfilters_connections cn
ON cn.element_id = fe.id
WHERE ct.alias = '".$conn->real_escape_string($_GET['alias'])."'
AND ct.state = 1
ORDER
BY ct.ordering
";
I would like to be able to just display it like this:
echo $contentcr[0]['id_ct'];
I want to still retrieve everything from web_content (which I named ct) but also name the id row differently. How can I do that?