SEO has nothing directly to do with server-side code like PHP. Search engines only see the client-side code that is sent to a user's browser. You therefore must apply SEO methods to the client-side code that is generated.
When a site is database-driven, it is important to make sure that HTML title tags and heading tags (h1, etc.) are customizable for each page. From a marketing perspective, the description meta tag is important. The keywords meta tag has little or no effect on SEO for major search engines and is therefore optional. Each of these is an additional column in your database and additional data that must be maintained on a page-by-page basis.
It's also a good idea to make sure that your client-side code validates using the W3C Validator
Hope this helps.