I would like to extract URL's from a mysql database. However I wish to link the URL to a single word 'CLICK' in a table.
The snippet of code below extracts data from a mysql database and puts it in a table as a series of rows. For each row there is a respective URL which I also wish to extract from the database. Instead of showing the full and long URL I just want to have the word CLICK against each row which people can then click to access that URL. Can any body tell me how that is done?
$q="SELECT * FROM railstp WHERE 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);