Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOtherTutorials

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 Codewalkers Forums Sponsor:
  #1  
Old July 3rd, 2004, 10:38 AM
nem nem is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 nem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
multiple column

hey i done a multiple column result table tutorial.

What i want is...

a column that has 2 rows, top row for image bottom for username...

how can i edit the code so this can be made possible?

I want 2 columns btw

Reply With Quote
  #2  
Old July 3rd, 2004, 04:58 PM
nem nem is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 nem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: multiple column

here is my code

php Code:
Original - php Code
  1. <? include("header.php"); ?>
  2. <?
  3. $columns = 2;
  4.  
  5. include('connect.php');
  6. $query = "SELECT * FROM members ORDER BY id DESC";
  7. $result = mysql_query($query);
  8. $num_rows = mysql_num_rows($result);
  9. echo "<TABLE BORDER="0">n";
  10. for($i = 0; $i < $num_rows; $i++) {
  11.     $row = mysql_fetch_array($result);
  12.     if($i % $columns == 1) {
  13.        echo "<TR>n";
  14.     }
  15.    
  16.      echo "<TD><TR>" . "<img src="$row[image] "/></img>" . "</TR></TD><TD><TR>" . $row['username'] . "</TR></TD>n";
  17.     if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows) {
  18.         //if there is a remainder of 1, end the row
  19.         //or if there is nothing left in our result set, end the row
  20.         echo "</TR>n";
  21.     }
  22. }
  23. echo "</TABLE>n";
  24. ?>
  25. <? include("footer.php");?> 


Why is it that they are not showing in columns vertically?

Reply With Quote
Reply

Viewing: Codewalkers ForumsOtherTutorials > multiple 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 6 hosted by Hostway