Simber33 Posted April 30, 2014 Share Posted April 30, 2014 What would be the best way do implement this situation in php and mySQL: I want users to be able to rate and review restaurants. This would mean that their ratings and reviews have to be inserted into the databse. This wouldn't be a problem. My question is, what is the most efficient and SEO friendliest way to show the ratings and reviews per restaurant. Should I make a script that generate a page for each restaurant? Or should I have one page which gets the data from the database for each company (would that be SEO friendly). Quote Link to comment https://forums.phpfreaks.com/topic/288140-most-efficient-and-seo-friendly-way-to-use-database-and-php/ Share on other sites More sharing options...
fastsol Posted April 30, 2014 Share Posted April 30, 2014 Yes you would get the info from the db and only use one page to echo out the info. To help with the SEO part you would want to gather the db info before any output to the browser occurs so that you can set the title tag and description tag to something that corresponds to the info gathered. SEO wise it really depends on what exactly you are trying to achieve when you mean SEO friendly. SEO initially comes from the title and description tags but also the content on the page which will vary based on the content provided by the customer reviews. Quick example <?php $get = getReviews(); // make some function to return a db list of info for the given url parameters ?> <html> <head> <title><?php echo (!empty($get['title'])) ? $get['title'].' | Default Text' : 'Default Text'; ?></title> <meta name="description" content="<?php echo (!empty($get['description'])) ? $get['description'] : 'Default Descrption'; ?>"/> </head> <body> <?php echo (!empty($get['review'])) ? $get['review'] : 'Sorry no reviews for that place';?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/288140-most-efficient-and-seo-friendly-way-to-use-database-and-php/#findComment-1477750 Share on other sites More sharing options...
davidannis Posted May 1, 2014 Share Posted May 1, 2014 It's also important to think about how the search engine gets to your page. The page should not be accessible only via a form, you need a link to it or you need to include it in a sitemap so that it gets indexed. Quote Link to comment https://forums.phpfreaks.com/topic/288140-most-efficient-and-seo-friendly-way-to-use-database-and-php/#findComment-1477766 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.