Reply to Pull Down Menu Query

Your name:

Reply:


Posted by cover on 07/26/07 06:15

I'm trying to populate the pulldown menus of a single input form
through queries from a single table. The three columns are 'name',
'type', and 'status'. The name table runs to approx row 23, the type,
to row 8, and status, row 9. . I'm using the following code to
populate the form pulldown menus::

<?php
$query = "SELECT DISTINCT status
FROM $table";
$result = mysql_query($query);
$number = mysql_numrows($result);

for ($i=0; $i<$number; $i++) {
$status = mysql_result($result,$i,"status");
print "<option value=\"$status\">$status</option>";
}

mysql_close();
?>


The interesting portion here is that 'name' only allows a single blank
space on the pulldown as I had expected and so does 'status'. 'Type'
on the other hand, shows 2 blank spaces on the pulldown menu so what's
with that? Is there some sort of 'end of file marker' that I should
be inserting to the database columns to get this to read correctly?
TIA

[Back to original 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

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