hi all I would like to convert data I get from DB into html page, for example: if the ID of a row in DB is 123 I need to display this row to www.sitename.com/displaypage-123.html Thnaks 4 ur reading.
You are either going to have to be more specific, or you should read up on how to process SQL data in PHP. You can start here; http://www.tizag.com/mysqlTutorial/ Here's something to get you started but be warned its very basic, at its best. <?php mysql_connect("localhost", "yourDBuser", "yourDBpassword") or die(mysql_error()); mysql_select_db("yourDB") or die(mysql_error()); $sql = "SELECT ID from yourtable WHERE yourconditions"; $res = mysql_query($sql) or die(mysql_error()); while($r = mysql_fetch_array($res)) { # Or include HTML to format as a hyperlink print "www.sitename.com/displaypage-".$r[0].".html<br />"; } ?> PHP:
thank u all but I need when I click an ID it must display the rest of the row to a new page, which means creating dynamic page
So, make a php file, i.e. displaypage.php, pass ID with GET (displaypage.php?id=123 or any other number) and put in php code to connect to mysql, and extract row with given ID. And if you want your link to look something like displaypage-123.html, use Apache's MOD_REWRITE. If it is to hard for you, PM me, i'll try to help you with this.
Thank u all 4 ur time especially WhyButUs I really need Apache's MOD_REWRITE. but I dont know how to do, now I am using displaypage.php?id=123 but I need to convert it as displaypage-123.html so please help me
Your .htaccess should look something like this: Options +FollowSymlinks RewriteEngine On RewriteRule ^displaypage-(.+)\.html$ displaypage.php?id=$1 [NC,L] Code (markup):
You need to generating a cache of the parsed output of a PHP page. Change 'your-folder/displaypage-123.html' to point to the location and name of your static html file. The folder and file should have write permissions ( 666 ). Php ob_start() starts the caching process. http://php.net/manual/en/function.ob-start.php