Skip to main content
Participating Frequently
June 12, 2009
Question

Dynamic links

  • June 12, 2009
  • 2 replies
  • 453 views

I have a recordset which displays in a dynamic table showing columns for Title, Series, Author and Date. The recordset also contains a field File_location which contains references to PDF files (ie the filename xxxx.pdf). I want to display this recordset in such a way that when the Title is clicked, it opens up the PDF file. Can't work out how to configure the a href.....

<?php do { ?>
            <tr>
              <td><?php echo $row_RSnotes['title']; ?></td>
              <td><?php echo $row_RSnotes['series']; ?></td>
              <td> <?php echo $row_RSnotes['author_firstname']; ?> <?php echo $row_RSnotes['author_lastname']; ?></td>
              <td><?php echo $row_RSnotes['date']; ?></td>
            </tr>
            <?php } while ($row_RSnotes = mysql_fetch_assoc($RSnotes)); ?>

This topic has been closed for replies.

2 replies

DwFAQ
Participating Frequently
June 13, 2009

<?php do { ?>
            <tr>
              <td><a href="<?php echo $row_RSnotes['file_location']; ?>"><?php echo $row_RSnotes['title']; ?></a></td>

              <td><?php echo $row_RSnotes['series']; ?></td>
              <td> <?php echo $row_RSnotes['author_firstname']; ?> <?php echo $row_RSnotes['author_lastname']; ?></td>
              <td><?php echo $row_RSnotes['date']; ?></td>
            </tr>
            <?php } while ($row_RSnotes = mysql_fetch_assoc($RSnotes)); ?>

Participating Frequently
June 12, 2009

Sorry code didn't display for some reason....

<?php do { ?>
            <tr>
              <td><?php echo $row_RSnotes['title']; ?></td>
              <td><?php echo $row_RSnotes['series']; ?></td>
              <td> <?php echo $row_RSnotes['author_firstname']; ?> <?php echo $row_RSnotes['author_lastname']; ?></td>
              <td><?php echo $row_RSnotes['date']; ?></td>
            </tr>
            <?php } while ($row_RSnotes = mysql_fetch_assoc($RSnotes)); ?>

David_Powers
Inspiring
June 12, 2009

I answered an almost identical question about one hour ago. See my answer here.