table1 has 6 column
table2 has 8 columntable3 has 10 columntable4 has 12 columnall the tables have a common NAME, say pid. i want to make a query in PHP which says, if, pid is found in table1, send the data to PHP query or else search in table2, or if not found, search in table3 or next in table4.
is there any way i can differentiate before hand based on column numbers, which table to search before making the query in PHP.