RE: [PHP-DB] Ordering question .....
| From: | USA) | Date: | Fri, 10 May 2002 16:15:14 +0000 |
| Subject: | RE: [PHP-DB] Ordering question ..... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19103@lists.php.net to get a copy of this message | ||
/t is a tab, however tabs won't show up in HTML, you'll have to use something like:
<>< Ryan
-----Original Message-----
From: Jim Hatridge [mailto:James.Hatridge@epost.de]
Sent: Friday, May 10, 2002 10:03 AM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Ordering question .....
Hi Bogdan et al...
Thanks! I've got that going now. I'm sure that I'll have more questions for
you as I work on it. In fact here's one now!
echo("$myrow[1] $myrow[2]<br>\n");
In the line above, how can I get a tab to work? I tried "\t" but that did not
work. Also the "\n" does not work on this line. In my program I took it out.
Thanks
JIM
On Thursday 09 May 2002 18:40, Bogdan Stancescu wrote:
> You could create a form using PHP's great feature of correctly
> retrieving arrays from POST requests. For example:
>
> ---------- page1.php ----------
> <form action="page2.php" method="post">
> <?
> // [connect to db]
> $sql="select id, name from stamp order by name";
> $result=mysql_run_query($sql);
> while ($myrow=mysql_fetch_row($result)) {
> echo("<input type=\"hidden\" name=\"ids[]\"
> value=\"$myrow[0]\">\n");
> echo("<input type=\"text\" name=\"quantities[]\">\n");
> echo("$myrow[1]<br>\n");
> }
> ?>
> <input type="submit">
> </form>
> -----------
>
> and then walk $_POST["quantities"] using an incrementing index ($i) and
> for every non-null value of $_POST["quanitites"][$i] you echo whatever
> you please from the database based on id $_POST["ids"][$i].
>
> HTH
>
> Bogdan
>
> Jim Hatridge wrote:
> >HI all..
> >
> >This is my first question to this list. I'm running mysql and SuSE 7.2
> > with PHP 4.
> >
> >My question: I have a table of stamps to sell (I'm a stamp dealer btw). I
> >want to make a order form with all the items in this table something like
> >this:
> >
> >_________ New Stamp #1
> >_________ New Stamp #2
> >
> >
> >And so on thru the table. I want to be able to put a amount in "_____"
> >ie "_____4 New Stamps #1" . Then when I click the submit button PHP will
> >make a new table of only the stamps with an amount in the "_____". Also
> > the number of stamps in the table might (will) change each time I use
> > this form, so I can't say X number of lines.
> >
> >Can someone give me a clue on how to do this? Please keep it simple I'm
> > new to this.
> >
> >Thanks!
> >
> >JIM
--
Jim Hatridge
Linux User #88484
------------------------------------------------------
BayerWulf
Linux System # 129656
The Recycled Beowulf Project
Looking for throw-away or obsolete computers and parts
to recycle into a Linux super computer
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php