PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

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 29th, 2002, 02:06 PM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
PHP Forum

okay, im tryin to make a small and simple forum, but am having trouble at the first hurdle

my problem is that i want each forum, or topic, to be in a new layout cell, which is fine, i can do that, although, when i echo it out, instead of them all being under each other, they're next to each other..no matter where i put <br> it just doesnt seem to work
php Code:
Original - php Code
  1.  
  2.  <?php
  3. $result = mysql_query("SELECT * FROM RM_forums");
  4. $i = 1;
  5. while($row = mysql_fetch_array($result))
  6. {
  7.     if(($quot = $i % 2) == 0)
  8.     {
  9.         echo "<td height="20" align="center" valign="top" bgcolor="#006699">";
  10.     }
  11.     else
  12.     {
  13.         echo "<td height="20" align="center" valign="top" bgcolor="#003366">";
  14.     }
  15. $i++;
  16. echo "<font face="Verdana" size="2"><a href="view_topic.php?id={$row['forum_id']}">{$row['forum_name']}</a></font>";
  17. echo "</td>";
  18. }
  19.  
  20. ?><br>


any help is much appreciated

Reply With Quote
  #2  
Old July 29th, 2002, 02:41 PM
Micah Micah is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: NC
Posts: 21 Micah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Micah
RE: PHP Forum

This is what I do...
www.forevercode.d2g.com/vb.php

<body bgcolor="black">
Choose a topic:
<br>
<table border="0" width="100%">
<tr>
<td width = "36%"><font color =#DDDDDD><b>Forum</font></td>
<td width = "32%"><font color =#DDDDDD><b>Author</font></td>
<td width = "12%"><font color =#DDDDDD><b>Date</font></td>
<td width = "10%"><font color =#DDDDDD><b>Msgs</font></td>
<table border='0' width='100%'><tr></tr></table><table border='0' width='100%' bgcolor=#999999>
<?

$link = mysql_connect("localhost", "user", "pass") or die("Could not connect");
mysql_select_db("Forum");

$query = "SELECT id, topic, uname, date, msgs FROM c ORDER BY id DESC;";

$result = mysql_query($query) or die("bad query");

if($result != ""){

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$u = 0;
foreach ($line as $col_value) {
$u++;

switch ( $u ) {
case 1:
$id = $col_value;
break;
case 2:
$topic = $col_value;
break;
case 3:
$aname = $col_value;
break;
case 4:
$date = $col_value;
break;
case 5:
$msgs = $col_value;
break;
default:
break;
}
}

$all = "<tr><td width = '36%' bgcolor=#000000><a href='ShowC++F.php?Num=$id'>$topic</a></td>rn <td width = '32%' bgcolor=#000000><font color = 'White'>$aname</td>rn <td width = '12%' bgcolor=#000000><font color = 'White'>$date</td>rn <td width = '10%' bgcolor=#000000><font color = 'White'>$msgs</td>rn</tr>";
echo $all;

}
}

?>

</table>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > PHP Forum


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