gevo12321 Posted June 23, 2007 Share Posted June 23, 2007 Im new to php, plz help ok so i have a database with 5 columns and a lot of rows i want to make a web page for each row with the same template is there a way to automatically do this or do i have to make each page ? thank you Quote Link to comment https://forums.phpfreaks.com/topic/56874-solved-template-help/ Share on other sites More sharing options...
chigley Posted June 23, 2007 Share Posted June 23, 2007 Not very hard, are you sure you want to physically create the files though? What's it for?.. there may be an easier option Quote Link to comment https://forums.phpfreaks.com/topic/56874-solved-template-help/#findComment-280994 Share on other sites More sharing options...
gevo12321 Posted June 23, 2007 Author Share Posted June 23, 2007 well i want to have a link to each file on the site its news articles it pretty much has a title and the date and the news so i dont know whats the easiest and most efficient way of doing this? Quote Link to comment https://forums.phpfreaks.com/topic/56874-solved-template-help/#findComment-280995 Share on other sites More sharing options...
chigley Posted June 23, 2007 Share Posted June 23, 2007 Personally I'd have a global read news page, which is accessed with get variables: eg. readnews.php?id=1 Where that script then reads from the database where id = 1. You could also use .htaccess to make it like /readnews/1 or something Quote Link to comment https://forums.phpfreaks.com/topic/56874-solved-template-help/#findComment-280996 Share on other sites More sharing options...
gevo12321 Posted June 23, 2007 Author Share Posted June 23, 2007 ok so i have a list of the articles and dates in this code: <?php require_once('connect.php'); $query=mysql_query("SELECT date,title FROM news ORDER BY date desc") or die(mysql_error()); while($row=mysql_fetch_object($query)) { $date1=$row->date; $title=$row->title; $date=date('m-d-Y',strtotime($date1)); echo $date; echo " "; echo $title; echo "<br>"; } ?> I want to have a link for each code to the corresponding article and all the articles use the same template how do i do this? Quote Link to comment https://forums.phpfreaks.com/topic/56874-solved-template-help/#findComment-281003 Share on other sites More sharing options...
gevo12321 Posted June 23, 2007 Author Share Posted June 23, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/56874-solved-template-help/#findComment-281042 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.