How I can do the same as in the script below using a loop?
$res = mysql_query("SELECT * FROM {$table_1} WHERE txn_id LIKE '%{$txn_id}%'
     UNION
     SELECT * FROM {$table_2} WHERE txn_id LIKE '%{$txn_id}%'
     UNION
     SELECT * FROM {$table_3} WHERE txn_id LIKE '%{$txn_id}%'
     UNION
     SELECT * FROM {$table_4} WHERE txn_id LIKE '%{$txn_id}%'
     UNION
     SELECT * FROM {$table_5} WHERE txn_id LIKE '%{$txn_id}%'Thanks.
