Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8974207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:37:43+00:00 2026-06-15T18:37:43+00:00

I hope this does not seem like a stupid question – I have been

  • 0

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>";

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:37:44+00:00Added an answer on June 15, 2026 at 6:37 pm

    Probably because there is nothing in your a tag

    Try something like this,

    echo '<a href="courses.php?id=' . $row['region_name'] . '">' . $row['region_name'] . '</a>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this question does not come off as broad as it may seem
I hope this question does not seem vague but I am converting the old
Hope this question is not stupid since I am an amateur web designer. I
I'm not sure if this question has been asked before, but I can't seem
How can I do this? (The following code does NOT work, but I hope
Hope this is not a dupe. I would like to be able to do
I hope this question isn't too dumb. We have many websites internally that need
I have been searching for an answer to this question for days and it
Not exactly how sure how to title this question, so I hope the title
Hope my question does not pose as too wide. So I try to frame

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.