[RESOLVED] Making Mysql data Output a Hyperlink
Results 1 to 2 of 2

Thread: [RESOLVED] Making Mysql data Output a Hyperlink

  1. #1
    Hello :)
    Join Date
    Sep 2009
    Location
    Anaheim, CA
    Posts
    64

    resolved [RESOLVED] Making Mysql data Output a Hyperlink

    Hi,

    I am a bit stumped on this one. I have a php script where data can get retrieved from a mysql database and it will display it in a table.

    I need to hyperlink the Customer Number, so when a user clicks on this number, it will go to the page specified.
    This Number is Shown from the database.

    echo "<td>" . $row['Customer_Number'] . "</td>";



    PHP Code:

    echo "<table border='1'>
     <tr>
     <th>Customer Number</th>
     <th>First Name</th>
     <th>Last Name</th>
     <th>Phone Number</th>
     <th>Email Address</th>
     </tr>"
    ;
     
    while(
    $row mysql_fetch_array($result))
       {
       echo 
    "<tr>";
       echo 
    "<td>" $row['Customer_Number'] . "</td>";
       echo 
    "<td>" $row['First_Name'] . "</td>";
       echo 
    "<td>" $row['Last_Name'] . "</td>";
       echo 
    "<td>" $row['Phone_Number'] . "</td>";
       echo 
    "<td>" $row['Email_Address'] . "</td>";
       echo 
    "</tr>";
       }
     echo 
    "</table>";
     
    mysql_close($con); 
    Last edited by akacj; 10-16-2012 at 02:57 AM. Reason: Spell Error

  2. #2
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,428
    Quote Originally Posted by akacj View Post
    I need to hyperlink the Customer Number, so when a user clicks on this number, it will go to the page specified.
    This Number is Shown from the database.
    What page? You didn't seem to specify any page.

    Regardless, the answer is simple: surround the text you wish to be a hyperlink with <a>...</a> anchor tags and supply the appropriate attributes, namely a 'href' one most likely.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •