For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > December 2004 > Re: [PHP-DB] [ Re: [PHP-DB] Filling Drop-Down Box.]









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] [ Re: [PHP-DB] Filling Drop-Down Box.]
Nayyar Ahmed

2004-12-28, 3:56 pm

Hello Alex:

It is really helpfull, :)

thanks for your detailed reply

regards,

On Sat, 25 Dec 2004 23:57:51 +0200, Alexandru Mihai <alexmihai@gmx.net> wrote:
> <SELECT name="student" title="Student list">
>
> <OPTION value="">---------------</OPTION>
> <?PHP
> while ($row = mysql_fetch_array($result)) {
> ?>
> <OPTION value="<?php echo $row[3]?>" title="Select student <?php
> echo $row[1]," ", $row[2]?>"> <?php echo $row[3]?></OPTION>
> <?php
> }
> ?>
> </SELECT>
> In this case I've assumed that you'll have in mysql the following table:
> row0: id (autoincrement)
> row1: Nick name
> row2: First name
> row3: Last name
>
> You can modify the code as you wish to get what you need.
>
> Alexandru Mihai
>
>
> Bastien Koert wrote:
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Nayyar Ahmad

Lecturer
Faculty Of Computer Science,
Institute Of Management Sciences,
Hayat Abad Peshawar , Pakistan.
Office : 92-091-9217404 , 9217452
Cell : 92-0333-9139461
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com