Tags:
databaser
Er der nogen der kan fortaelle mig hvordan man laver et hyperlink i et mysql resultset. Se kode eksempel herunder :
<div class="WADAResultsContainer"> <a name="top"></a>
<div id="WADAPageTitleArea">
<div id="WADAPageTitle">Page Title</div>
<div><a href="photogallery_Search.php">New Search</a></div>
</div>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<?php if ($totalRows_WADAphotogallery > 0) { // Show if recordset not empty ?>
<div class="WADAResults">
<div class="WADAResultsNavigation">
<div class="WADAResultsCount">Records
<?php echo ($startRow_WADAphotogallery + 1) ?>
to
<?php echo min($startRow_WADAphotogallery + $maxRows_WADAphotogallery, $totalRows_WADAphotogallery) ?>
of
<?php echo $totalRows_WADAphotogallery ?>
</div>
<div class="WADAResultsNavTop">
<table border="0" cellpadding="0" cellspacing="0" class="WADAResultsNavTable">
<tr valign="middle">
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, 0, $queryString_WADAphotogallery); ?>" title="First"><img border="0" name="First" id="First" alt="First" src="WA_DataAssist/images/Desert Spice/Traditional_first.gif" /></a>
<?php } // Show if not first page ?></td>
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, max(0, $pageNum_WADAphotogallery - 1), $queryString_WADAphotogallery); ?>" title="Previous"><img border="0" name="Previous" id="Previous" alt="Previous" src="WA_DataAssist/images/Desert Spice/Traditional_previous.gif" /></a>
<?php } // Show if not first page ?></td>
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery < $totalPages_WADAphotogallery) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, min($totalPages_WADAphotogallery, $pageNum_WADAphotogallery + 1), $queryString_WADAphotogallery); ?>" title="Next"><img border="0" name="Next" id="Next" alt="Next" src="WA_DataAssist/images/Desert Spice/Traditional_next.gif" /></a>
<?php } // Show if not last page ?></td>
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery < $totalPages_WADAphotogallery) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, $totalPages_WADAphotogallery, $queryString_WADAphotogallery); ?>" title="Last"><img border="0" name="Last" id="Last" alt="Last" src="WA_DataAssist/images/Desert Spice/Traditional_last.gif" /></a>
<?php } // Show if not last page ?></td>
</tr>
</table>
</div>
<div class="WADAResultsInsertButton"> </div>
</div>
<table class="WADAResultsTable" border="0" cellpadding="0" cellspacing="0">
<tr>
<th class="WADAResultsTableHeader">ID:</th>
<th class="WADAResultsTableHeader">Country:</th>
<th class="WADAResultsTableHeader">City:</th>
<th class="WADAResultsTableHeader">Island:</th>
<th class="WADAResultsTableHeader">Url:</th>
<th> </th>
</tr>
<?php do { ?>
<tr class="<?php echo $WARRT_AltClass1->getClass(true); ?>">
<td class="WADAResultsTableCell"><?php echo($row_WADAphotogallery['ID']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAphotogallery['Country']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAphotogallery['City']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAphotogallery['Island']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAphotogallery['Url']); ?></td>
<td class="WADAResultsEditButtons" nowrap="nowrap"><table class="WADAEditButton_Table">
<tr>
<td><a href="photogallery_Detail.php?ID=<?php echo(rawurlencode($row_WADAphotogallery['ID'])); ?>" title="View"><img border="0" name="View<?php echo(rawurlencode($row_WADAphotogallery['ID'])); ?>" id="View<?php echo(rawurlencode($row_WADAphotogallery['ID'])); ?>" alt="View" src="WA_DataAssist/images/Desert Spice/Traditional_zoom.gif" /></a></td>
</tr>
</table></td>
</tr>
<?php } while ($row_WADAphotogallery = mysql_fetch_assoc($WADAphotogallery)); ?>
</table>
<div class="WADAResultsNavigation">
<div class="WADAResultsCount">Records
<?php echo ($startRow_WADAphotogallery + 1) ?>
to
<?php echo min($startRow_WADAphotogallery + $maxRows_WADAphotogallery, $totalRows_WADAphotogallery) ?>
of
<?php echo $totalRows_WADAphotogallery ?>
</div>
<div class="WADAResultsNavBottom">
<table border="0" cellpadding="0" cellspacing="0" class="WADAResultsNavTable">
<tr valign="middle">
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, 0, $queryString_WADAphotogallery); ?>" title="First"><img border="0" name="First1" id="First1" alt="First" src="WA_DataAssist/images/Desert Spice/Traditional_first.gif" /></a>
<?php } // Show if not first page ?></td>
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, max(0, $pageNum_WADAphotogallery - 1), $queryString_WADAphotogallery); ?>" title="Previous"><img border="0" name="Previous1" id="Previous1" alt="Previous" src="WA_DataAssist/images/Desert Spice/Traditional_previous.gif" /></a>
<?php } // Show if not first page ?></td>
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery < $totalPages_WADAphotogallery) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, min($totalPages_WADAphotogallery, $pageNum_WADAphotogallery + 1), $queryString_WADAphotogallery); ?>" title="Next"><img border="0" name="Next1" id="Next1" alt="Next" src="WA_DataAssist/images/Desert Spice/Traditional_next.gif" /></a>
<?php } // Show if not last page ?></td>
<td class="WADAResultsNavButtonCell" nowrap="nowrap"><?php if ($pageNum_WADAphotogallery < $totalPages_WADAphotogallery) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_WADAphotogallery=%d%s", $currentPage, $totalPages_WADAphotogallery, $queryString_WADAphotogallery); ?>" title="Last"><img border="0" name="Last1" id="Last1" alt="Last" src="WA_DataAssist/images/Desert Spice/Traditional_last.gif" /></a>
<?php } // Show if not last page ?></td>
</tr>
</table>
</div>
</div>
</div>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAphotogallery == 0) { // Show if recordset empty ?>
<div class="WADANoResults">
<div class="WADANoResultsMessage">No results for your search</div>
<div> </div>
</div>
<?php } // Show if recordset empty ?>
</div>
</body>
</html>
<?php
mysql_free_result($WADAphotogallery);
?>
1 svar postet i denne tråd vises herunder
1 indlæg har modtaget i alt 3 karma
Nøjes venligst med at poste den kodestump der omhandler dit problem og ikke hele scriptet. Brug også code-tags.