Hey guys,
Here's the deal. I have a 600+ static html website that is a pain in the butt to update. My BS degree was in computer science, however, I have no knowledge of php whatsoever. I did however take a database class where we learned very basic stuff like ER diagrams, relational schemas, relational algebra, SQL commands, queries, etc.
I already have my database built. And as mentioned, I already have a website online with 600+ html pages, 95% of which are all the same basic template page...just a different product on each page. In case that wasn't clear, my site has over 600 product pages, which all come from the same template...the only difference is that each page has a different product. So the name of the product is different, description is different, price, etc. But the look of each page is identical. And again, I already have all this stuff in a database. I just don't know how to work php with the database.
Here's one way I think works, but it seems stupid. Basically, instead of my having 600+ html pages, I can make 600+ php pages, so i will now have product1.php, product2.php, product3.php, etc, and then the querying of the database will be done on each specific productX.php page. So within product4.php, I would query the database requesting the tuple of productID 4, and then I would get whatever i needed from that row. But this method seems to not take advantage of what I think php can do. (I could be wrong)
Can someone tell me if my following understanding of how I would ideally like to use php is correct or incorrect.
For my product pages, which are currently numbering over 600, is it correct that i would essentially make just one page and call it, for example, product.php. This page would be designed however I like using html code, graphics, etc., and then i would basically query the database in the URL, so when the customer goes to click on a product, they url would be something like http: //www .mydomain.com/product.php?productID=blah (i don't know the syntax). And then I would have pre-coded the template product.php page, and basically I will reference the current product query and tell it to put the "name" of the product, that resulted from the query, in "this" particular spot, and the "description" in this spot, and the "picture" in this spot, etc. Is that how this is done?
I hope that long question made some sense. And if the second method is how people use php pages where the base page is basically the same, in the case, hundreds of products, can anyone recommend a spot where i can go to see examples of this. I have search google for php mysql "query in the url" and i get very few results.
Hopefully you guys can point me in the right direction.
Thanks.
Jonathan