I have a table called page and I query this, for instance,
SELECT *
FROM page
and I access the data each row in this table columns like this $item->title;
I want to know if I can select the row of this table and at the same time I can retrieve what name is this table I am selecting? So when I do this,
echo $item->table_name; then I get this – page
is it possible?
You could, of course, do something like this:
Asking what table you obtained a row from doesn’t really make a whole lot of sense though. What would you expect the result to be if you had executed a join? What about a union of two queries that select different tables?