I hope this does not seem like a stupid question – I have been sat for about half an hour trying to tweak the code below to get it to work as desired but no luck so far…
Basically, the code below is intended to form a the basis of a ‘regions’ page linking to pages for each of these regions. However, at the moment when this is run on the page there is no hyperlink for the first region name pulled from the database, and hence the rest of the link’s pages are all out by one row of the data ie:
Regions
Borders – no link created
Central – links to courses.php?id=borders
Highlands – links to courses.php?id=central
Western – links to courses.php?id=highlands
And so on
etc etc
I’ve not had much experience embedding the array row data into links of any sort before so perhaps I just need to tweak the syntax, any pointers would be much appreciated.
$query = "SELECT * FROM regions ORDER BY region_name";
$result = mysql_query($query);
if (!$result) die ("Database access failed: " . mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['region_name'];
echo "<a href='courses.php?id=".$row['region_name']."'</a>";
echo "</br>";
}
Probably because there is nothing in your
atagTry something like this,