You are here: Re: Joining search queries « PHP Programming Language « IT news, forums, messages
Re: Joining search queries

Posted by Jerry Stuckle on 10/08/07 14:12

Alec wrote:
> On 18 Sep, 10:21, gosha bine <stereof...@gmail.com> wrote:
>> On 17.09.2007 23:22Alecwrote:
>>
>>> Sorry newbie question...
>>> I have made two different search queries on the same table.
>>> How can Ijointhese together in one list, so the results from the
>>> first query come listed before the second, ie keeping the same order.
>> $results = array();
>>
>> while($row = mysql_fetch_assoc($query_1))
>> $results[] = $row;
>>
>> while($row = mysql_fetch_assoc($query_2))
>> $results[] = $row;
>>
>> If this is not what you're looking for, please be more specific.
>>
>> --
>> gosha bine
>>
>> makrell ~http://www.tagarga.com/blok/makrell
>> php done right ;)http://code.google.com/p/pihipi
>
> Gosha
>
> Thanks for the help and sorry for the delay in a reply.
>
> Sadly I have tried the SQL group today but with no joy.
>
> To be more specific about the problem, I have made two different
> search queries on the same table that both
> retain the identical column information.
>
>
> $resultfirst = @mysql_query ("SELECT company, address1, address2 FROM
> table1 WHERE category=active ")
>
>
> $resultsecond = @mysql_query ("SELECT company, address1, address2
> FROM
> table1 WHERE category=inactive ")
>
>
> How can I now join these together in one list, with the results from
> the first query being listed before the second, ie keeping the same
> order.
>
>
> Many thanks
>
>
> Alec Thorne
>
>

I don't know where you asked, but it certainly wasn't in
comp.databases.mysql, which is the appropriate newsgroup.

This one isn't.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация