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

  • Home
  • SEARCH
  • 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 7408833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:58:52+00:00 2026-05-29T05:58:52+00:00

I like to put links into a html table, these links are query from

  • 0

I like to put links into a html table, these links are query from the mysql table

------------------------------
item Number |  Item purchased
------------------------------
1           |  a vase
2           |  a candle

etc.....
10
------------------------------
           <<1,2,...100|next>>

this is difficult to me. Could someone offer me an idea or a library for me to start with ?
Thank you so much

  • 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-05-29T05:58:53+00:00Added an answer on May 29, 2026 at 5:58 am

    If you use a CMS like AlientWebguy is suggesting, you’ll never learn… and I assume you’re here to learn. You should start with a tutorial though, as this is pretty basic stuff.

    But to accomplish what you are trying to do – if I was a novice – this is what I would do. I’m not going to give you your code, but it’s is definitely close enough that you should be able to figure it out.

    I would make a file called functions.php that included the following:

    <?PHP
    // these are freebies.  You don't need to understand them yet.
    function sqlarr($sql, $numass=MYSQL_BOTH) {
        // MYSQL_NUM  MYSQL_ASSOC  MYSQL_BOTH
        $got = array();
        $result=mysql_query($sql) or die("$sql: " . mysql_error());                             
    
        if(mysql_num_rows($result) == 0)
            return $got;
        mysql_data_seek($result, 0);
        while ($row = mysql_fetch_array($result, $numass)) {
            array_push($got, $row);
        }
        return $got;
    } 
    
    // Sql fetch assoc
    function sqlassoc($sql){
        $query = mysql_query($sql) or die("$sql:". mysql_error());
        $row = mysql_fetch_assoc($query);
        return $row;
    }
    
    function sqlrow($sql){
        $query = mysql_query($sql) or die("$sql:". mysql_error());
        $row = mysql_fetch_row($query);
        return $row;
    }
    
    function sqlquery($sql){
        $query = mysql_query($sql) or die("$sql:". mysql_error());
        return $row;
    }
    
    ?>
    

    Then on the file that I was going to output data, I would put the following:

        <?PHP  include('./functions.php'); 
        // It sounds like you are already connected to your database, so I'm going to skip that.  If you need it, add a comment.
        $sql = "SELECT `colNames`, `colName2` FROm `tableName` WHERE `col` = 'condition' ";
        // obviously change this to your names, such as `itemNumber`
        $results = sqlarr( $sql ); // Now results is going to automatically contain a 2D array.  
        echo '<pre>'; print_r( $results ); echo '</pre>';
        /* this is just to show you what is happening so far.  You should get in the habit of using things like this to debug.  A lot of people prefer var_dump instead of print_r.  I use both because var_dump is harder to read.
        // Result should be returning something like this:
        // array(
                [0] => array(
                        [0] => 'ABC123',
                        ["itemNumber"] => 'ABC123',
                        [1] => 'http://www.abc.com',
                        ["link"] => 'http://www.abc.com' ),
                [1] => array( ... )
                )
        // the first level - the [0] => array(  or the [1] => array( part - corresponds to a row in your database
        // so now we need a way to filter through those rows.  Look up php.net/for or php.net/foreach to see how to accomplish that.  A lot of people use php.net/while too, but I don't prefer that personally. */
        ?>
        <html>
        <body>
        <table>
        <?PHP
        foreach( $results as $row ){  // this is turning $result[0] => array(  into $row.  So now we can access $result[0]['linkName'] as $row['linkName']
           echo '<tr><td>'.$row['linkName'].'</td></tr>';
        }  // foreach $row - dont forget to close your curly bracket.  Good practice is to always close it as soon as you open it, and to put a comment after it like I just did letting you know what it goes to
        ?>
        </table>
        </body>
        </html>
    

    If anything doesn’t make sense here, just leave a comment. I’m happy to explain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to put a placeholder into e.g. the footer.html and have it
I would like to be able to get html-formatted data from mysql, and turn
I would like to put a string into a byte array, but the string
Possible Duplicate: How can I remove external links from HTML using Perl? Alright, i'm
I downloaded a html theme from a website and i'm trying to put it
I need to print out csv file into html or put a numeric data
I am reading a table row from one page, and then trying to put
I would like to put a link to a webpage in an alert dialog
I'd like to put in an UIButton in the center of the navigation bar.
I would like to put user controls on pages without registering the tag at

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.