php - Extracting URL's from mysql database and setting as single word clickable link -
i extract url's mysql database. wish link url single word 'click' in table.
the snippet of code below extracts data mysql database , puts in table series of rows. each row there respective url wish extract database. instead of showing full , long url want have word click against each row people can click access url. can body tell me how done?
$q="select * railstp download='$changeday'"; $r=mysqli_query($mysql_link,$q); if ($r) { echo "<strong>network rail schedule (stp) updates downloaded: $changeday</strong>"; echo "<p> </p>"; echo "<table id='customers'> <tr> <th>headcode</th> <th>traction</th> <th>from</th> <th>to</th> <th>departing</th> <th>destination</th> <th>depart</th> <th>arrive</th> <th>atoc</th> <th>runs</th> <th>load</th> <th>speed</th> </tr>"; while ($row=mysqli_fetch_array($r,mysqli_assoc)) { echo "<tr>"; echo "<td>".$row['headcode']."</td>"; echo "<td>".$row['traction']."</td>"; echo "<td>".$row['startdate']."</td>"; echo "<td>".$row['enddate']."</td>"; echo "<td>".$row['depart']."</td>"; echo "<td>".$row['arrive']."</td>"; echo "<td>".$row['departtime']."</td>"; echo "<td>".$row['arrivaltime']."</td>"; echo "<td>".$row['atoc']."</td>"; echo "<td>".$row['runs']."</td>"; echo "<td>".$row['load']."</td>"; echo "<td>".$row['speed']."</td>"; echo "</tr>"; } echo "</table>"; } else {echo '<p>'.mysqli_error($mysql_link).'</p>' ;} } show_records($mysql_link); mysqli_close($mysql_link);
add row code:
echo "<td><a href='".$row['url']."'>click</a></td>";
what add url parameter link link text show click. replace url column name url.
Comments
Post a Comment