I can see that this problem has been addressed several times. But I can not quite figure out how to apply the various answers to my particulars.
I have created two tables for proccessing two different kinds of customer orders. Both have several unique columns. But there is some information in both that is similar. I would like to have the contents of both tables displayed together on a page and sorted by each orders date no mater which table the record is in and at the moment both date fields ar labeled differently.
Here's my code for getting the information from one table:
$orders_qry = "
SELECT *
FROM Orders_Special
ORDER BY Order_Date DESC, record_number DESC
LIMIT $startnum , 20
";
$orders_res = mysql_query($orders_qry);
while ($orders_row = mysql_fetch_array($orders_res))
{
list( $record_number, $Customer_Info, $Order_Detail, $Order_Date, $Order_Number, $Email, $Order_Status, $Tracking_Number, $Paid_By, $Notes, $Payment_Amount, $Shipping_Cost, $Product_Cost, $Date_Shipped, $Handeled_By ) = $orders_row;
As you can guess I go on to have the information dispalyed out in a table. You can also probably see that I am only displaying a limited number of records and using next and previous links for veiwing a large number of records.
From what I can gather from other posts using a Union would do the job. I guess what is a little confusing is how the MySQL and PHP syntax should come together.
I probably didn't provide enough info to get a good inital answer. If you need more info just let me know.