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 8618047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:00:59+00:00 2026-06-12T06:00:59+00:00

I have a column in a DB that populates a list within a table

  • 0

I have a column in a DB that populates a list within a table of the top gaining athletes on my fantasy sports website, on the website I would like to be able to have “Jamal Charles” be a url and have it linked to the internal webpage for Jamaal that was already created. below the table I have the function that is calling the “companyname” – companyname is actually the athletes name.

How would I make the “companyname” a link to its own page in this table? Would i make another function that calls the url instead? Make another column that accepts urls and call that? I hear that sometimes the database will only echo the url text and not make it a link. Is any of the possible?

Please let me know if you need more code. Thanks in advance everyone!

Top Gaining Athletes Today
1. Jamaal Charles 0.54 %
2. Kyle Rudolph 0.50 %
3. A.J. Green 0.48 %
4. Michael Bush 0.48 %
5. Jared Cook 0.47 %
6. Christian Ponder 0.45 %
7. Alfred Morris 0.45 %
8. Nate Washington 0.44 %
9. Ryan Succop 0.44 %
10. DeMarco Murray 0.43 %

function getTopAthletes($connection){
$i=1;
$query = "SELECT b. companyname, (a.currentprice - a.open)/a.open as performance FROM jm_market a, jm_stocks b WHERE a.symbol = b.symbol AND active = 'Y' ORDER BY performance desc LIMIT 10";
$result=mysql_query($query,$connection) or die('Problem with obtaining top PLAYERS: ' . $query); 
$output = "<table class='tab1 bborder' cellspacing='0'>";
$output.= "<th colspan='4'>Top Gaining Athletes Today</th>";
while($row=mysql_fetch_array($result)){

  // Shorten really long names
  if (strlen($row['companyname']) > 20) {
     $short = split (' ', $row['companyname']);
     $row['companyname'] = substr( $short[0],0,1 ) . ". ";
     unset($short[0]);
     foreach ($short as $n) {
        $row['companyname'] .= $n . " ";
     } 
     $row['companyname'] = rtrim($row['companyname']);         
  }

    $output .="<tr ><td width='20px'><strong>" . $i.".</strong></td>";
    $output .="<td ><strong>" . $row['companyname']."</strong></td>";
    $output .="<td><strong>" . number_format(($row['performance']) * 100,2)." %</strong></td></tr>";
    $i++;

}
$output .= "</table>";
return $output;

}

  • 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-12T06:01:00+00:00Added an answer on June 12, 2026 at 6:01 am

    Try this

    $output .="<td ><strong><a href='users.php?username=" . $row['companyname']."'>". $row['companyname']."</a></strong></td>";
    

    That should give you

    <a href='users.php?username=John'>John</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a varchar column that has data like this top<somenumber> so the word
I have a SQL script that populates a temp column and then drops the
I have an (access) database table which contains data I would like to populate
Scenario: I have a list table being populated from a combobox. That list table
I am new to MVVM . I have list box that populates the list
I have a column ProviderName in table main that is populated thus: Alaska Medicaid
I have two columns in a table that are populated with integer values. For
I have a column that has the following data: PersonId=315618 LetterId=43 MailingGroupId=1 EntityId=551723 trackedObjectId=9538
I have a column that contains links. The problem is that the titles of
I have a column that I need to be able to guarantee never gets

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.