OK - I'm def not a db/code guru so a lot of the concepts mentioned are probably over my head. I'm a brute force type of 'programmer' (and I use that classification loosely...Very loosely).
I had a main table setup like this:
deal
deal_id
store_id
start_date
end_date
deal_type
category
title
item
description
deal_link
price
active
I had another table with the store's information (name, url, etc).
Now I think the table above is 1nf. I'm pretty sure it's not 2nf since there will be repeating subsets. Now, as I mentioned before, I wasn't going for eligence - i'm just trying to get something (sort of) working so I am concentrating more on the sql query and output formatting rather than the db design.
In my table, I was planning to use a query based upon date in order to bring up only the current deals:
$sql = 'SELECT * '
. ' FROM deal '
. ' WHERE end_date >= curdate( )';
As of right now, I can output:
'store_id' has a 'item' on 'deal_type' for 'price'. 'description' and get:
Toyota has a Camry on sale after rebate for $17,000. Just select the CE option and add ABS.
So basicaly, I need to get my databases into better shape (thanks for the urls) and try to get the php to output everything dynamically. The latter is the real issue for me. Just like trying to understand a recursive function, trying to get data across multiple tables all from a single query eludes me. I undestand the concept, but implementing it is always too much for me.
I know (think) that the 'where end_date >= curdate()' should start me off getting all my 'active' deals. I guess i just need to figure out the code to output it all.
I'd like in the end to be able to simply use dropdown boxes to select most of the data such as store, item etc. etc (have one working for store_id) and just fill in the blanks. Once entered into the db, my web page should be able to spit out beautifully and grammatically correct paragraphs for each deal. I have many a long nights ahead of me.