PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 10th, 1999, 09:15 PM
Robert
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi,

I'd like to output some query results in a table, each result in it's own column and row. Here's an example --

***********************************
IF ($result){
echo "<center><table><tr><td>";
while ($r = mysql_fetch_array($result)) {
$number = $r["stock_number"];
$description = $r["item_description"];
echo "$number<br></td>";
echo "<td>$description<br>";
}
echo "</td></tr></table>";
} else
{
echo "No data.";
*********************************

Except it doesn't work correctly. What is the proper way to accomplish this?

Thanks

Reply With Quote
  #2  
Old July 11th, 1999, 07:58 AM
Borry
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hello,

please try this out :

You've got to make once a table and you got to embed for each productnr. and description a own row and column.

I hope this will help you out !

***********************

echo "<center><table>";
IF ($result)
{
while ($r = mysql_fetch_array($result))
{
$number = $r["stock_number"];
$description = $r["item_description"];
echo "<tr><td>$number<br></td>";
echo "<td>$description</td></tr>";
}
echo "</table>";
} else
{
echo "No data.";

*********************************

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Output into table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT