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
How can i display these results in a HTML table?
Moderator: General Moderators
-
- Forum Newbie
- Posts: 2
- Joined: Thu Mar 29, 2018 10:32 pm
- Christopher
- Site Administrator
- Posts: 13592
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: How can i display these results in a HTML table?
Please reply to posts in the forum, instead of PM, so all users can get the benefit of your answer. Thanks.deepvyas wrote:Hello Sheila,
Greetings!
I sent you PM
Please check
Regards
Deep
(#10850)
- Christopher
- Site Administrator
- Posts: 13592
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: How can i display these results in a HTML table?
Typically you would loop through the rows of database results and write each line of the 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
Code: Select all
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>";
(#10850)