mysql query select * from....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ullasvk
Forum Newbie
Posts: 21
Joined: Fri Feb 13, 2009 11:55 pm

mysql query select * from....

Post by ullasvk »

Hello friend ,

I am doing a project where 1st dropdown value populates the second drop down menu.
i have a table with three columns id, length and breadth with values as

id length breadth
1 72 36
2 74 30
3 76 28
4 78 25

How to write a mysql query with selected value at first and remaining after that i.e, if i select length 76 the second drop down menu must contain 28 and remaning all values like this

1st menu 2nd menu
length breadth
76 28
72 36
74 30
78 25

I wrote the code in Ajax but i require the query for this.
Please anyone help me.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: mysql query select * from....

Post by jaoudestudios »

Something like this...

Code: Select all

SELECT * FROM [table] WHERE length = 76
Post Reply