oasmar Posted October 22, 2007 Share Posted October 22, 2007 <?php $query = "SELECT * FROM $links WHERE originaldir = $dirlink ORDER BY displayorder ASC"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $redirtable = $row['redirtable']; $redirid = $row['redirid']; $pagetype = $row['pagetype']; if(!empty($redirid)){ require 'article.php'; } } ?> article.php <?php $result = mysql_query("SELECT * FROM $article WHERE articleid = $redirid"); while($row = mysql_fetch_array($result)){ echo $containerbegin; echo'<table width="100%" border="0" cellpadding="0" cellspacing="0" > <tr> <td><h1>'.$row['header'].'</h1><br /></td> </tr> <tr> <td><span style="font-size:12px; color: #FFFFFF; text-align:left">'.$row['content'].'</span></td> </tr> <tr> <td><br /><span style="font-size:12px; color: #FFFFFF; text-align:left">Posted by '.$row['poster'].' on '.$row['postdate'].'.</span></td> </tr> </table>'; echo $containerend; } ?> The script kinda works, the only problem is that the first file should have several repitions of the article.php but for some reason it will only display article.php once. However, i change "include 'article.php';" with "echo 'test';" it will display the word test 4 times. The script should bring up article 4 times each one with a different post from the table $article. Link to comment https://forums.phpfreaks.com/topic/74366-solved-help-data-from-table/ Share on other sites More sharing options...
darkfreaks Posted October 22, 2007 Share Posted October 22, 2007 <?php if(!empty($redirid)){ return include('article.php'); }?> Link to comment https://forums.phpfreaks.com/topic/74366-solved-help-data-from-table/#findComment-375734 Share on other sites More sharing options...
oasmar Posted October 22, 2007 Author Share Posted October 22, 2007 Sorry to say but that does not seem to have done anything . Thanks for helping though. Link to comment https://forums.phpfreaks.com/topic/74366-solved-help-data-from-table/#findComment-375750 Share on other sites More sharing options...
oasmar Posted October 23, 2007 Author Share Posted October 23, 2007 Anyone got any other suggestions on how to get this working? Link to comment https://forums.phpfreaks.com/topic/74366-solved-help-data-from-table/#findComment-376058 Share on other sites More sharing options...
oasmar Posted October 23, 2007 Author Share Posted October 23, 2007 I no longer need any help as i have rewrote the script so that it functions in the same way but does not have the same problem. . Link to comment https://forums.phpfreaks.com/topic/74366-solved-help-data-from-table/#findComment-376074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.