Alright so I have a website which displays a bunch of different rows from a database on a single page, but I want to expand the site so each individual row has its own page where more in depth information on the record can be found.. The sites database is mysql btw... Im decent enough at coding to figure it out if someone can give me a basic breakdown or refer me to somewhere where the matter is discussed more.. Thanks. MF20
(Mainly geared towards PHP) First set up your procedure: - Take input (i.e, some parameter, page.php?page=??? ) - look up in database table - Output table content <?php $page = $_GET['page']; $db = mysql_connect('localhost', 'db_username', 'myPa$$word'); mysql_select_db('datbase-name'); $page = mysql_real_escape_string($page); $sql = "SELECT * FROM pages WHERE url = '$page' "; $result = mysql_query($sql); $row = mysql_fetch_assc($result); echo "<html><head><title>{$row['title']}</title></head><body>{$row['body']}</body></html>"; Code (markup): The table (called 'pages') has 3 columns: url varchar(40) title varchar(255) body text http://php.net/manual/en/book.mysql.php Some of my code I wrote may have some syntax errors or spelling issues with the function names, verify they are correct in that manual page.
thanks.. yeah i know how to do that.. for some reason i was thinking it would be a lot more complex. do you by any chance know how well pages like that (which include characters like question marks) do in the search engines?
You should be using URL rewriting rather than having an actual parameter to optimise it for SEO but other than that the fact that they are being generated from an SQL on the fly rather than being static HTML will have no impact (other than the very rare unfortunate cases when google bot tries to spider whilst theres a sql connection error etc)