thanks for that tip, it will stop me from getting to these annoying errors now.
Now, when i preview my data dont show in 2 columns and go in rows... instead it goes down in 1 row.
preview:
http://www.69kilobytes.co.uk/members.php
script:
<? include("header.php"); ?>
<?
$columns = 2;
include('connect.php');
$query = "SELECT * FROM members ORDER BY id DESC";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
echo "<TABLE BORDER=\"0\">\n";
for($i = 0; $i < $num_rows; $i++) {
$row = mysql_fetch_array($result);
if($i % $columns == 1) {
echo "<TR>\n";
}
echo '<tr><td><img src="' . $row[image] . '" /></td></tr><tr><td>' . $row['username'] . '</td></tr>';
if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows) {
//if there is a remainder of 1, end the row
//or if there is nothing left in our result set, end the row
echo "</TR>\n";
}
}
echo "</TABLE>\n";
?>
<? include("footer.php");?>
-
- <? include("header.php"); ?>
-
- <?
-
- $columns = 2;
-
-
-
- include('connect.php');
-
- $query = "SELECT * FROM members ORDER BY id DESC";
-
- $result = mysql_query($query);
-
- $num_rows = mysql_num_rows($result);
-
- echo "<TABLE BORDER=\"0\">\n";
-
- for($i = 0; $i < $num_rows; $i++) {
-
- $row = mysql_fetch_array($result);
-
- if($i % $columns == 1) {
-
- echo "<TR>\n";
-
- }
-
-
-
- echo '<tr><td><img src="' . $row[image] . '" /></td></tr><tr><td>' . $row['username'] . '</td></tr>';
-
- if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows) {
-
- //if there is a remainder of 1, end the row
-
- //or if there is nothing left in our result set, end the row
-
- echo "</TR>\n";
-
- }
-
- }
-
- echo "</TABLE>\n";
-
- ?>
-
- <? include("footer.php");?>
-
-
Tables seem to be fine to me, its when i preview it when i get :S confused.
Anyone is free to this script after just like the others on the other posts.
GSDomains.com -Click here - Packages starting from £3.69 a month. 1.5GB Space & 10GB Bandwidth.