You are here: selection from a list box. « PHP Programming Language « IT news, forums, messages
selection from a list box.

Posted by fetchpiyush on 11/18/34 11:43

Hi, I am pretty new to php and have to implement this functionality to
select a user from a list box. I have written the code for this, but
the problem is after selecting a name and doing the required task, it
again selects the first entry in the list box. So if there are 100
users, the 100th one has to scroll down again and again.

I need to modify this code so that until the session expires, if a
person has selected his name once, that name will be selected in the
listbox until he changes it.


<select name="name" style="width: 120px;">
<?php
$query = sprintf("select * from person order by person_name");
$result = mysql_query($query);
$i = 0;
while($row = mysql_fetch_array($result))
{
$i++;
printf("<option
value=\"$row[person_num]\">$row[person_name]</option>");
}
?>
</select>



Regards,
Piyush

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация