Hi everyone! First time on this board, go easy on me!

Ok I have a website with lots of .htm pages.....e.g:

CODE

index.htm
main
about us
contact us
find us
history

....and so on, and rather than have all of these pages, i would like to convert it to SQL and PHP, so i only have 1 php page, and the text contents of each page is now stored in the database.

So my question is how would i go about doing this and what code would i need.

This is what i understand i would need........

lnks:

main =
CODE

index.php?page=main

then im stuck on how to tie that link in with the database query....something like?

<?php

$sql="SELECT main FROM database";
if ($result=mysql_query($sql)) {
if ($row=mysql_fetch_row($result)) {
echo "$row[0]";
}
} else {
echo "<!-- SQL Error ".mysql_error()." -->";
}

?>

or if anyone knows of an easier system or ....?

Cheers
Daz

    Write a Reply...