PHP Developers Network
http://forums.devnetwork.net/

How can i display these results in a HTML table?
http://forums.devnetwork.net/viewtopic.php?f=17&t=147153
Page 1 of 1

Author:  sheilaanderson [ Mon Apr 02, 2018 9:36 pm ]
Post subject:  How can i display these results in a HTML table?

hello,

i am trying to figure out how i can display results in a html table

when the customer types in their order number i want to show only certain fields of each row . there will be multiple rows with the same order number?

anybody can give me an idea of what my code should be looking like?

thank you

Author:  deepvyas [ Tue Apr 03, 2018 5:00 am ]
Post subject:  Re: How can i display these results in a HTML table?

Hello Sheila,
Greetings!
I sent you PM
Please check

Regards
Deep

Author:  Christopher [ Tue Apr 03, 2018 12:03 pm ]
Post subject:  Re: How can i display these results in a HTML table?

deepvyas wrote:
Hello Sheila,
Greetings!
I sent you PM
Please check

Regards
Deep

Please reply to posts in the forum, instead of PM, so all users can get the benefit of your answer. Thanks.

Author:  Christopher [ Tue Apr 03, 2018 12:07 pm ]
Post subject:  Re: How can i display these results in a HTML table?

sheilaanderson wrote:
hello,

i am trying to figure out how i can display results in a html table

when the customer types in their order number i want to show only certain fields of each row . there will be multiple rows with the same order number?

anybody can give me an idea of what my code should be looking like?

thank you

Typically you would loop through the rows of database results and write each line of the table.
Syntax: [ Download ] [ Hide ]
echo "<table>";
echo "<tr><th>ID</th><th>Name</th></tr>";
foreach ($rows as $row) {
    echo "<tr><td>{$row['id']}</td><td>{$row['name']}</td></tr>";
}
echo "</table>";

You could also output JSON from PHP and use Javascript to generate the table.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/