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
|
 |
 |
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
|
 |
 |
montymoose
Posts: 85
|
| Posted: 09/23/2007, 3:19 AM |
|
thanks so much
|
 |
 |
|