Create text hyperlink from url stored in mysql DB

I’m pretty green where PHP is concerned and needs some help on a project.

I have a mysql DB that tracks federal legislation and has links to the bills and related documents stored in a DB field call bill_href_tag. The information on each bill is displayed in repeating rows of a matrix table.

I can pull the text of each bill’s url into the table “Bill Name” field with this code:

<?php echo $row_rsMatrix2['bill_href_tag'];echo "\n" ?>

which displays the actual link text, for example:
http://www.gpo.gov/fdsys/pkg/BILLS-112s1660pcs/pdf/BILLS-112s1660pcs.pdf

What I want to do is wrap the link’s href tags around the displayed text of the bill number and bill summary (also in the “Bill Name” field and called like this:

<?php echo $row_rsMatrix2['billnumber']; ?>, <?php echo $row_rsMatrix2['billsummary']; echo ",\n" ?>

like this S1660, American Jobs Act of 2011

so the viewer only sees a link called “S1660, American Jobs Act of 2011” to click on …

I think the way to do it might be to create an array, but I can’t figure out how to do it. I also need to be able to display the text for recently updated bills by calling a $font_color = red variable and wrapping the entire contents of each table cell … but first things first.

Any help greatly appreciated.

Thanks

Bob

The following show work.
[php]<?php
echo ‘’.$row_rsMatrix2[‘billnumber’].’, ‘.$row_rsMatrix2[‘billsummary’].’\n’;
?[/php]

Thanks much! It did the trick. I had tried something similar but didn’t concatenate the strings properly. Appreciate the quick help!

Sponsor our Newsletter | Privacy Policy | Terms of Service