Move <select></select> outside the do-while loop:

print "<SELECT name=rapped>";

$row = 0;
do
{
         $myrow = pg_fetch_array($result,$row);
         if ($myrow['rupload'] != "") {

                 print "<option>{$myrow['rfname']} 
{$myrow['rsname']}</option>";

         }

         $row++;
} while ($row < $numrows);

print "</select>";

pg_close($db);

--

- Jacob

At 09:56 09/19/2002, Andre Dubuc wrote:
> > > <?php
> > > . . .
> > > $query = "SELECT * FROM rap WHERE rsponsor = '{$_SESSION['sid']}'";
> > > $result = pg_exec($db, $query);
> > > if (!$result) {exit;}
> > > $numrows = pg_numrows($result);
> > >
> > > if ($numrows == 0) {echo "<h2>Sorry!<br><br>'{$_POST['sid']}' is not in
> > > the our database.<br><br> Click 'Back' on
> > >  your browser to enter another search.<br><br></h2>"; exit;}
> > >
> > > $row = 0;
> > > do
> > > {
> > > $myrow = pg_fetch_array($result,$row);
> > >  if ($myrow['rupload'] != "")
> > > {
> > >
> > >  print "<SELECT name=rapped><option>{$myrow['rfname']}
> > > {$myrow['rsname']}</select>";
> > >
> > > }
> > >
> > > $row++;
> > > }
> > > while ($row < $numrows);
> > > pg_close($db);
> > > ?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to