Announcement

Collapse
No announcement yet.

Need help with while loop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with while loop

    I'm trying to include a file inside a while loop.
    Here is the part I'm having trouble with.
    PHP Code:
    while($row=mysql_fetch_array($result))
    {
        
    $file=$row[file_name];
        
    $description=$row[description];
        
    $file="<a href=\"ctr.php?$this_file=$file\">$file</a>";
        echo 
    "<tr><td bgcolor=\"royalblue\"><font size=\"-1\">$file</font></td>
                  <td><font size=\"-1\">  
    $description</font><br><img src=\"border.png\"></td>
                  <td bgcolor=\"royalblue\" align=\"center\">Need to include a file here</td></tr>"

    Any help would be great.

  • #2
    PHP Code:
    while($row=mysql_fetch_array($result))
    {
        
    $file=$row[file_name];
        
    $description=$row[description];
        
    $file="<a href=\"ctr.php?$this_file=$file\">$file</a>";
        echo 
    "<tr><td bgcolor=\"royalblue\"><font size=\"-1\">$file</font></td>
                  <td><font size=\"-1\">  
    $description</font><br><img src=\"border.png\"></td>
                  <td bgcolor=\"royalblue\" align=\"center\">"
    ;
        include (
    $file);
        echo 
    "</td></tr>"

    Comment


    • #3
      Thanks for your help.
      I got the results I needed using
      PHP Code:
      $file_content join''file$file_name )); 

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X