I have this sql that gets the posts by the terms:
SELECT * FROM posts where content like '%" . $_GET['term'] . "%'"
but I want to search more tables like tags and users at once. i.e.
SELECT * FROM users where username like '%" . $_GET['term'] . "%'"
SELECT * FROM topics where tag like '%" . $_GET['term'] . "%'"
and I was wondering how I can combine them all together into query. I know you have to do something with As
statement i.e.
content as Value
username as Value
tag as Value
and I also want to get the type of query returned i.e. if the result returned is a user, that will be TYPE user, so I can distinguish them.