View Full Version : databse results?

12-06-2007, 05:55 PM
Hello! I am a new user, but I've spend a few weeks reading it, and I'm fascinated! Greetings!

My question is: I've seen the video tutorial about the php dropdown menu. My question is how can I show the results? I cant figure out how to do this. For example: You choose make from the menu, then choose model from the menu and after sellection what is the php that shows the result for the model from the db?

Thanks in advance! Greetings!

12-06-2007, 07:35 PM
hi Lestat

did you get the dropdowns working?

as far as they took you (i.e populating the second dropdown)

12-06-2007, 07:57 PM
yes. but now ???

12-06-2007, 08:21 PM
that was it

it explained how to code dynamic drop downs.

you take what i show you and adapt it to make it your own

what were you wanting

12-06-2007, 10:10 PM
I am actually experiencing problems with the part when you select an item from the second menu. I can't write the php code that will relate the selected item with the record of the database and will show this record in a table for instance. Can you please help me by posting the php code required? Cause I really can't do this...

12-07-2007, 05:45 AM

first i never do the work for you

if you have followed my vids then you have the dynamic dropdown working. You need to pass a value from this dropdown into your database query

you know how to write a database query. Yes?

12-07-2007, 06:51 AM
$query1="select * from " .
$result = mysql_db_query($dbname, $query1)

12-07-2007, 07:55 AM
once the query has been executed the you will want to retrieve the db rows using the mysql_fetch_assoc() function.

then you will be able to echo the info returned from the db query.

php.net is the definite source on what php functions do and how to use them.

12-07-2007, 11:04 AM
as you pass a value from dropdown1 into dropdown2 you would use the same method to pass a value to a query for display

they are the same thing except your not populating values in a dropdown your building a result