I use dreamweaver, PHP and MYSQL.

I need some help and any is appreciated, I have alot of knowledge in html learnt from some college, little in php

and none in mysql, I am self teaching php and mysql, so forgive me if the question is too easy.

Ok so I have a database with many tables, " Table A that is the main table which has some details in it

(long_description, short_description, type ), a primary key and 4 foreign keys ( table B ID, Table C ID, Table D

ID and Table E ID).

I have managed to display the data with all the tables joined to create 1 record.

but now I am stuck at trying to create a search, using a URL parameter passed between 2 pages using the get method.
The search page has a form, a drop down list populated by table B and the submit button. The URL parameter gets

passed on with no problem, and I even see it on the url when I preview and test it.
I am trying to filter the results so that they show records that are related to a particular ID in table B and I

have no Idea what syntax to use in the sql.

I have managed to get up to showing results of table A but I have no Idea on how to join the other tables to the


Hope that makes sense,

Can anyone Help??

see below

"SELECT property_listings_db.property_listing_title, property_listings_db.short_description,

ireland_states_db.state_name, listing_type.type_name, listing_images_db.proimagethumbFilename, city_db.city_name,

property_listings_db.propertydb_ID FROM property_listings_db, ireland_states_db, listing_type, listing_images_db,

city_db WHERE property_listings_db.city_ID = city_db.city_ID AND city_db.state_ID = ireland_states_db.state_ID AND

property_listings_db.type_ID = listing_type.type_ID AND property_listings_db.propertydb_ID =

listing_images_db.propertydb_ID ORDER BY property_listings_db.propertydb_ID DESC"

the url parameter being passed is state_ID and it looks something like this

since the sql statement above worked without the url paramerter, is ther a way to filter it using the url

parameter, i.e to only show results of state_ID=1? hope that makes sence,

I had tried to use colname in the where clause (of the statement above (AND city_db.state_ID =

ireland_states_db.state_ID = state_ID = %s)) but it gave me an error, "State_ID where clause is ambiguous "

the below statement works using the URL parameter but leaves out all the other 4 tables. and only shows the

property_listings_db table.

"SELECT propertydb_ID, property_listing_title, bathrooms, bedrooms, state_ID, city_ID, property_listing_date,

type_ID, property_listing_price, long_description, short_description FROM property_listings_db WHERE state_ID = %s

ORDER BY property_owner_ID DESC"

hope that explains alot.