Dreamweaver has some pre-cooked PHP code that hooks to databases. All I've really done is noted its existence and disapproved of the code it barfs out, but maybe you could use that to build something?
Failing that, I recommend OSCommerce (
http://www.oscommerce.org). It's PHP, it's Open Source, and it works. It won't play nice with your templates, though, it'll want to run the whole site for you.