Re: note 90860 deleted from function.mysql-field-name by thiago
| From: | Daniel Brown | Date: | Wed, 13 May 2009 13:27:24 +0000 |
| Subject: | Re: note 90860 deleted from function.mysql-field-name by thiago | ||
| References: | 1 2 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154551@lists.php.net to get a copy of this message | ||
This one should've been modified as opposed to deleted. Note the
"creativity" (error) on behalf of the poster: he/she placed the
description in the field intended for the email address. In such a
case, it would be enough to copy the description into the body,
leaving the note as an anonymously-posted item. No matter, though....
if the user wants to re-post, hopefully he/she will pay a bit more
attention this time. ;-P
On Wed, May 13, 2009 at 09:05, <thiago@php.net> wrote:
> Note Submitter: lists headers, data and is sortable
>
> ----
>
> <?php
> include("dbconnect.php");
>
> $spalte = $_GET["spalte"];
> $dir = $_GET["richtung"];
>
> if($dir == "ASC"): $dir = "DESC";
> else: $dir = "ASC";
> endif;
>
> $query="SELECT * FROM spieler ORDER BY $spalte $dir";
> $result=mysql_query($query);
> $numfields = mysql_num_fields($result);
>
> echo "<table><tr>";
>
> $counter = 0;
>
> for ($i=0; $i < $numfields; $i++) // Kopf
> {
> $feld = mysql_field_name($result, $i);
>
> echo "<th><a href=index.php?spalte=". $feld .
> "&richtung=" . $dir . ">" . $feld . "</a></th>";
>
> }
>
> echo "</tr>";
>
> while ($row = mysql_fetch_row($result)) // Daten
> {
>
> if($counter % 2 == 0): $color = "#FFDDDD";
> else: $color = "#DDFFFF";
> endif;
>
> echo "<tr bgcolor=". $color . "><td>" .
> implode($row,"</td><td>")."</td></tr>";
>
> $counter++;
> }
>
> echo "</table>";
> ?>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000