I have these tables:
category table:
cat_id (PK)
cat_name
category_options table:
option_id (PK)
cat_id (FK)
option_name
option_values table:
value_id (PK)
option_id (FK)
value
classifieds table:
ad_id (PK) (VARCHAR) something like "Bmw330ci_28238239832"
poster_id (FK)
cat_id (FK)
headline
description
price
etc....
posters table:
poster_id (PK)
name
email
tel
password
etc....
Three main questions:
1- Is the above good enough? It covers all my needs atleast...
2- Sometimes when I try out different queries, I get strange results... Could you write a PHP query string which will fetch one complete ad from an ad_id only? (imagine the only variable you have is ad_id)
3- In the query string, must I specify all different tables which are connected in order to display an ad? Can't I just use something like "SELECT * FROM classifieds WHERE ad_id=$ad_id" and it would handle the links automatically, ie fetch all related information also?
Thanks and if you need more input let me know!