I have two tables like following
images_table
id | image_name | image_file
-----+---------------+------------------
1 | flower | rose.jpg
2 | fish | gold_fish.jpg
-----+---------------+----------------
tags_table
tag_id | tag_name | image_id
---------+--------------+---------------
1 | rose | 1
2 | red flower | 1
3 | redfish | 2
4 | aquarium | 2
---------+--------------+------------------
When someone search, I am using the following query
SELECT * FROM images_table WHERE image_name LIKE "%$search"
But I need to show results from both tables. ie combination of following queries
SELECT * FROM images_table WHERE image_name LIKE "%$search"
SELECT * FROM tags_table as tags LEFT JOIN images_table as img ON img.id=tags.image_id WHERE tags.tag_name LIKE "%$search"
How can I get both results as a single array/list? So that I can implement pagination as well.