Re: filling in form with for loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- In php-objects@xxxxxxxxxxxxxxx, "Ken" <ken.poyser@...> wrote:
>
> What does    $List    has??!!
> 
> Ken
> 
> 
> 
> --- In php-objects@xxxxxxxxxxxxxxx, "perfectsolution1" <drshea@> 
> wrote:
> >
> > Can anyone help me work this out? I have an array with a room number
> > associated with fname, lname, etc.  I know the number of rooms, and
> > want to fill in the form with textbox where the room is empty, and
> > with the persons name in the room associated with the specific room.
> > This is my code I have come up with that only gives me the table 
> once
> > with the first person, and text boxes in the other rooms.
> > 
> > $row=mysql_fetch_array($List);
> > 	for($i=1;$i<=12;$i++){
> > 
> > echo "<td align='center'>";
> >   if($row['room']!=$i){
> > echo"$i</td>";
> > echo"<td align='center'><input type='text' name='lname'></td>";
> > echo"<td align='center'><input type='text' name='fname'></td>";
> 				}			
> > 		 else {	
> > 			 
> > echo "$row[room]</td>";  
> > echo "<td align='center'><a href = 'Edit.php?ID=$ID'>"
> > .ucfirst($row[lname])." </a></td>";
> > echo "<td align='center'><a
> > href='Edit.php?ID=$ID'>".ucfirst($row[fname])."</a> </td>";
> > 			}
> >
>
Thank you for responding. My query is:
$query_List = "SELECT room, lname, fname FROM info ORDER BY room";
$List = mysql_query($query_List, $pmAdmin) or die(mysql_error());


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux