Re: better looking ?
| From: | Mukul Sabharwal | Date: | Mon, 23 Oct 2000 03:44:20 +0000 |
| Subject: | Re: better looking ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-21710@lists.php.net to get a copy of this message | ||
while (list($id, $name, $desc) =
mysql_fetch_row($query)) {
if ($x == 0) {
echo "<tr><td><a href=$PHP_SELF?catid=$id>$name</a> -
$desc</td>";
$y = $x = 1;
continue;
}
if ($x == 1) {
$y++;
echo "<td><a href=$PHP_SELF?catid=$id>$name</a></td>";
if ($y > $cols) $x = 2;
continue;
}
if ($x == 2) {
echo "</tr><tr><td><a
href=$PHP_SELF?catid=$id>$name</a></td>";
$x = 1;
}
}
This will solve the 2nd last problem of all same
column things, I know there's a better way, I've done
it myself, but I don't have the source right now....
though this should be ok...
--- Larry Linthicum <webmaster@RetrieverSports.net>
wrote: > My website uses PHP and MySQL to generate
many
> pages, most of them lists of
> one sort or other.
>
> I'm new tto this, and the only way I've seen to
> display such lists is in a
> HTML table, using 'While" looping
>
> it works, but it gets visually boring after a while
>
> can anyone point me to pages (AND/ OR code) that
> have nice looking and
> varied display of such data?
>
> are multiple column displays possible with arrays
> containing a single
> database field's values?
>
> while ($row-mysql_fetch_array($result)) {
> $name = $row[name];
> echo
>
> "<tr><td>$name</td><td>$name</td><td>$name</td>";
> }
>
> seems to print the same name 3 times, in each table
> row, instead of cycling
> through the array, how is this supposed to be done?
>
> anyone using Flash to display database lists more
> interestingly? example
> sites?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
To Find Out More About Me : http://mukul.tsx.org/
__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf! It's FREE.
http://im.yahoo.com/