SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 28th, 2002, 04:51 AM
yayang yayang is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 2 yayang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
show result on table by column

i try to show result from mysql db using table.

but i don't know how to loop it ;

example ; if i have 10 result then i want it divide to 2 column

and if i got result more than 10 i want the result divide into 3 column.

how to do that ?

p.s : i usually make simple table in frontpage and then copy it for looping.

Reply With Quote
  #2  
Old October 28th, 2002, 07:40 AM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
PHP Code:
<?
$sql 
mysql_query("SELECT * FROM table");

if(
mysql_num_rows($sql) >= 11)
{
     while(
$row mysql_fetch_array($sql))
     {
?>
          <table><tr>
          <td>Column 1</td>
          <td>Column 2</td>
          <td>Column 3</td>
          <tr></table>

     <?}
}
else
{
     while(
$row mysql_fetch_array($sql))
     {
?>
          <table><tr>
          <td>Column 1</td>
          <td>Column 2</td>
          <tr></table>

     <?}
}
?>

Last edited by Taelo : October 28th, 2002 at 07:43 AM.

Reply With Quote
  #3  
Old November 3rd, 2002, 06:36 PM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
hey yayang,

did Taelo's solution work??

Just interested to know!

Cheers!!
__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
  #4  
Old November 3rd, 2002, 10:03 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I just remembered to ask how do we display stuff in different pages

just pass a page number and in mysql query statement start from there till next for example 30 fetches? i hope its like that..
__________________
Hungry for Code

Programming works best with a team over one single person

Reply With Quote
  #5  
Old November 4th, 2002, 04:13 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
I think it's exactly like that, yeah!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > show result on table by column


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 5 hosted by Hostway