If you added a dummy field in the table that is minus one field, you might use the merge table, but I honestly have no idea whether this would be more or less efficient than sorting arrays in memory. Guess that would depend on the sizes of the tables and the number of records you'll be returning.
http://www.mysql.com/doc/en/MERGE.html ----- Original Message ----- From: "Mark McCulligh" <[EMAIL PROTECTED]> Newsgroups: php.general To: <[EMAIL PROTECTED]> Sent: Tuesday, April 01, 2003 12:33 PM Subject: Re: [PHP] Array Question > I have looked at the different JOINs but I can't link any fields together. > There is no relationship between the tables. The two table are basically the > same table. But the DBA didn't make them one like he should have. > > Mark. > > > "Skate" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > look into things like JOIN and SORT BY in MySQL, they're quicker and more > efficient than PHP for doing DB stuff (so i'm told) > > took me awhile to get my head around JOIN, but once you've got it, you'll > never be without it ;) > > > "Mark McCulligh" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I have two tables that I want to display together as if they were one > table > > and order them by a common date field. > > > > Because I am using MySQL I can't use the usually way I would do this. > Create > > a store procedure or view. > > > > I was thinking of creating two separate queries in PHP then loading the > data > > into one Array. In short loop though both tables copying the records into > an > > array. > > > > Then I was going to sort the Array my a common date field. Then of course > > loop through printing the Array. > > > > My question is: Is this the best way to do this or is there another way. > > Also how can you sort an Array by one date field. > > > > Any ideas on how to do link two tables together and sort my a common dat e > > field. > > > > Thanks, > > Mark. > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php