Hello everyone,
I have been trying to solve this problem for too long now, and was hoping someone maybe able to help me solve my problem.
I basically want to be able to UNION 2 tables together and order the contents by date and time.
i.e.
Honda Civic 01/02/08 10:45am (From database CARS)
Chevy Cobalt 01/02/08 11:45am (From database CARS)
Ford F-50 02/03/08 1:05pm (From database TRUCK)
[php]
<?php
require('config .php');
$result = mysql_query("(S ELECT * FROM cars) UNION (SELECT * FROM truck) order by date desc, time desc");
while($row=mysq l_fetch_array($ result))
{
$make=$row["make"];
$model=$row["model"];
$date=$row["date"];
$time=$row["time"];
echo "$make";
echo "$model";
echo "$date";
echo "$time";
}
?>
[/php]
I appreciate any help :)
I have been trying to solve this problem for too long now, and was hoping someone maybe able to help me solve my problem.
I basically want to be able to UNION 2 tables together and order the contents by date and time.
i.e.
Honda Civic 01/02/08 10:45am (From database CARS)
Chevy Cobalt 01/02/08 11:45am (From database CARS)
Ford F-50 02/03/08 1:05pm (From database TRUCK)
[php]
<?php
require('config .php');
$result = mysql_query("(S ELECT * FROM cars) UNION (SELECT * FROM truck) order by date desc, time desc");
while($row=mysq l_fetch_array($ result))
{
$make=$row["make"];
$model=$row["model"];
$date=$row["date"];
$time=$row["time"];
echo "$make";
echo "$model";
echo "$date";
echo "$time";
}
?>
[/php]
I appreciate any help :)
Comment