There are no fields that are related. The ID field is auto increment and each is unique to the other.
What happens when a product in table 1 has the same exact id as one in table 2? How do you know which product you are talking about?
I need to query both tables and then display the data through a while loop with a where clause, (ex where : color = blue), order by datetime DESC and limit 3. So it would display rows from both tables that have blue in the color field, and if the data was fetched from table 2 then the other columns that are not in table 1 would also display (material, finish, style, quality)...
Something like this would fetch the data:
SELECT id, color, bran, `date`, motor, tire, NULL, NULL FROM table_1
SELECT * FROM table_2
However, you wouldn't know if field 5 was a motor a material unless you selected something extra to let you know:
SELECT 'T1', id, color, bran, `date`, motor, tire, NULL, NULL FROM table_1
SELECT 'T2', * FROM table_2
That first field would let you know for a given record whether it came from table 1 or table 2. However, you still have a problem that if you have 10 items in table 1 returned by this query then you probably won't see any items from table 2 if you are just pulling 3 or 6 items.
Another problem with this is that you probably wouldn't be able to use associative indexes when looking at your data. Instead of $row['motor'], you'd probably have to use $row instead -- if mysql doesn't complain about different data types or something.
The only way I can use UNION is by setting the extra columns to 'blank' in the query, but then the second union will have null data and it would be useless.
The data would not be useless -- finish/style/quality values would not be fetched for table 1 because they don't make sense for cars (or bicycles or whatever).
I can add null columns to the other tables of where they are missing, but this is inconvenient when there are many different fields.
The reason you are having problems is because you either need to redesign your database structure to support what you are trying to do or you need to abandon this query thing you are doing. It is quite awkward.
If I run two queries and grab for example 3 rows from each table with the where and order clauses, how would I display only 3 rows out of the 6 I grabbed from the two tables in a while loop?
You're going to have to figure that one out yourself. What criteria do you want to use to pick 3 out of the 6? Randomly? Ordered by price?
You just need to think more about what you are trying to accomplish here.