Help needed please

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
HotaHota
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2004 10:24 am

Help needed please

Post by HotaHota »

I want to create a dropdown menu that will filter my database in this way:If I have a field in my table with cities and I want to find some infos from another field for one specific city ,how do i show the infos for that city only?
Thnx in advance guys...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Code: Select all

select `some infos` from cities where city='$somevar'
Something like this. Depends on db and programming language used.
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

... and use a jump menu to fill this $someVar:
  • $someArray <- cities names;
  • use printSelect($someArray, 'cities', $_POST['cities'], 'onChange="javascript:document.form1.submit();"') to draw the jump menu.
Hope that helps,
Scorphus.
HotaHota
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2004 10:24 am

Post by HotaHota »

Thnx a lot guys you were very helpful :) :) :)
Post Reply