I hate to simply refer to other sources in a response, but cross-tabulations are a 
large and rich subject which are
too large for the time I have to write this email. I would suggest reading this 


which is a pretty good source of information on how to obtain some very useful results 
from MySQL tables. Be more than
happy to answer questions on cross-tabs though - it's a very fun way to query.


Barry Rumsey wrote:

> I have two tables, the first one I query like :
> $query = "SELECT * FROM xp_topics WHERE artist_count='artist' AND topictext LIKE
>           'B%' ORDER BY artist_count DESC limit 0,5"; $req = mysql_query($query);
>           $res = mysql_num_rows($req); if ($res == 0) { echo "</p>
>           <p><b>Sorry there is no result.</b>";} else { while($row = 
>             { extract($row); echo ("$topictext<br>
>             "); } }
> The second one I want to do a count for each one that was returned above. eg Billie 
>(2) , Bill (4) Bret (1)........
>  How would I set up the query to do both?

Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to