PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Aug 14, 2018 7:07 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Apr 02, 2018 9:36 pm 
Offline
Forum Newbie

Joined: Thu Mar 29, 2018 10:32 pm
Posts: 2
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


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 5:00 am 
Offline
Forum Newbie

Joined: Fri Jul 07, 2017 6:43 am
Posts: 5
Hello Sheila,
Greetings!
I sent you PM
Please check

Regards
Deep


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 12:03 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13572
Location: New York, NY, US
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.

_________________
(#10850)


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 12:07 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13572
Location: New York, NY, US
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.

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group