I currently have a couple tables that I’m joining together so I can form all of the relevenat results into a news feed of recent activity. The only problem I’m having is figuring out which table the information is coming from.
$recentActivity = mysql_query("
SELECT *
FROM members
LEFT JOIN market
ON members.id = market.user
LEFT JOIN sales
ON members.id = sales.uid
WHERE members.id='$id'
");
I’m then running a while loop
<? while ($recent = mysql_fetch_assoc($recentActivity)) { ?>
If the result in the loop comes from the market table I would like to be able to echo “market” or something like that and do the same if it comes from the sales table.
Hope this makes sense.
You cannot. The only possible way is to explicitly specify aliases for all (necessary)
markettable fields. Like:etc. The same with
salestable