SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

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 May 29th, 2005, 10:56 AM
kzar kzar is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 kzar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 30 sec
Reputation Power: 0
change the order the data are showing

Hey guys, hello.
I need help with a problem...
When i retrieve data from my dd, the results are shown in colums.
Is it possible to arrange the data to appear in rows?
To be specific, I have two tables (categories and products).
I want to show the products that belong to a category in rows (3 results per row)
For example something like this:
1 2 3
4 5 6
7 8

Is there some specific sql command?
Is it a php problem?
Any suggestions would be greatly appreciated
P.S. even an article somewhere would be fine

Thanks in advance

Reply With Quote
  #2  
Old May 29th, 2005, 04:07 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
Your database can only spit the data out; any visual arranging needs to be done in your script. In PHP, a simple solution is:

PHP Code:
 $counter 0;
 
 while(
$row mysql_fetch_array($result) )
 {
   if(
$counter == 3)
   {
      echo 
'<br>';
      
$counter 0;
   }
 
   echo 
$row['field'];
 
   
$counter++;
 } 
__________________
"A pawn is the most important piece on the chessboard -- to a pawn"


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > change the order the data are showing


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