Hello, I've done some research the last couple days and haven't been able to get anything to work... What I need is a PHP script to display a list of venue names [venueName] and link them to the URL [venueMap] stored in a database. I can connect to the database and list the 'venueName' but cannot figure out how to associate that with the URL stored in the 'venueMap' column. Any help?
after some research and some manipulation, I'm left with... <table width="600" border="0" cellspacing="2" cellpadding="2"> <tr> <td><?php do { ?> <?php echo <a href= . $row_Venue_set['venueMap'] . $row_Venue_set['venueName']</a>; ?> </td> <td> </td> </tr> <tr> <td><?php } while ($row_Venue_set = mysql_fetch_assoc($Venue_set)); ?></td> <td> </td> </tr> </table> Code (markup):
well aside from the database connection script here's the php query: mysql_select_db($database_Venue, $Venue); $query_Venue_set = "SELECT venueName, venueMap FROM Venue ORDER BY venueName ASC"; $Venue_set = mysql_query($query_Venue_set, $Venue) or die(mysql_error()); $row_Venue_set = mysql_fetch_assoc($Venue_set); $totalRows_Venue_set = mysql_num_rows($Venue_set); PHP: I'm not quite sure what you mean by database structure. It's mysql with a table called Venue that contains 5 or 6 rows. Two of which are [venueName] and [venueMap]. the Name is simple text, the Map is a http:// URL. I need to import both of them, but only display the text (venueName) as a link. It should look like this: www.musl.net/venue_test.php Except this example isn't dynamic.
is this what you mean: <table width="600" border="0" cellspacing="2" cellpadding="2"> <tr> <td><?php do { ?> <?php echo '<a href="'. $row_Venue_set['venueMap'] .'">'. $row_Venue_set['venueName'].'</a>'; ?> </td> <td> </td> </tr> <tr> <td><?php } while ($row_Venue_set = mysql_fetch_assoc($Venue_set)); ?></td> <td> </td> </tr> </table> PHP: