This is a discussion on MySQL Multiple tables / results within the PHP Language forums, part of the PHP Programming Forums category; Hopefully someone here can help. I would like to perform multiple queries to a MySQL database and have all the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
RG writes:
> Hopefully someone here can help. > I would like to perform multiple queries to a MySQL database and have all > the results in 1 result set. > Is this possible? How do you mean? You could do this for example: select * from table where (<query 1>) or (<query 2>); Which would return the union of the results of the two queries. -- __o Alex Farran _`\<,_ Analyst / Programmer (_)/ (_) www.alexfarran.com |
|
|||
|
On Sat, 13 Sep 2003 11:34:16 +0100, "RG" <Me@NotTellingYa.com> wrote:
>Hopefully someone here can help. >I would like to perform multiple queries to a MySQL database and have all >the results in 1 result set. >Is this possible? Not unless you give more details. In general, no; how do you delimit the multiple result sets? What if each query returns a different number and type of columns? It becomes nonsensical very quickly. -- Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space) |
|
|||
|
Do the tables have common connections, so that you can do a JOIN?
(are they related in some way?) http://www.mysql.com/doc/en/JOIN.html You need to be more specifc and tell us your table structures and what you want out of the query if you'd like more help. -Kurt http://www.quanetic.com RG wrote: > Hopefully someone here can help. > I would like to perform multiple queries to a MySQL database and have all > the results in 1 result set. > Is this possible? > > TIA > RG > > |