CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dropdown with record count

Print topic Send  topic

Author Message
montymoose


Posts: 85
Posted: 09/21/2007, 4:49 AM

Hello again!

Sorry for bombarding you with posts, Just doing loads of work with CSS at the mo.

==============
This is a problem which is baffling a friend of mine. He has two simple tables using PHP and MYSQL (latest versions):

### - MAKE - ###
----------------------------
MAKEID_____MAKENAME
1____________ford
2____________nissan
3____________toyota

### - MODEL - ###
----------------------------
MODELID_____MAKELINKID_____MODELNAME
1_________________1____________focus
2_________________1____________fiesta
3_________________1____________explorer
4_________________3____________yaris
5_________________3____________camary

On the homepage of the website, he has a dropdown menu with a list of the MAKES on it, and links to the correct pages.(a simple search builder grid). However he wants to display the number of models in the MODEL table which are linked to each entry.

Example:

DROPDOWN --->
Ford (3)
Nissan (0)
Toyota (2)

Any suggestions?

Thanks again,

M00S3
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/22/2007, 3:17 AM

  
select MAKEID,   
            concat( MAKENAME, '(', (select count(MODELID) from MODEL where MAKELINKID = MAKEID), ')'  ) FROM MAKE  
  

MySQL
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
montymoose


Posts: 85
Posted: 09/23/2007, 3:19 AM

thanks so much
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.