You are here: <select> not populating form fields (php,mysql) « PHP « IT news, forums, messages
<select> not populating form fields (php,mysql)

Posted by Ian Rutgers on 10/19/88 11:30

Situation:

I have a form which collects a bunch of data. The form accesses two tables
(users and assignment_details). The user table is accessed to get the
userid (to be saved in an assignment_details record) and to display other
users table info (for display only). There is other information being
collected to be saved in the assignment_details table, but it is not
relevant to the issue.

I am using a <select> to display user names, and extract the appropriate
userid. The <select> tag uses a query to pull all the names from the users
table. When the form is loaded all defined fields from the users table are
displayed on the form. Selecting a different name doesn't result in
extracting and displaying the result of the user fields (as in the code
below): ... help!
..
..
..
<td><select name="adetails_employee_id">
<?php
do {
?>
<option value="<?php echo
$row_rsEmployeeLookup['id_usr']?>"><?php echo
($row_rsEmployeeLookup['first_name_usr'] . ' ' .
$row_rsEmployeeLookup['last_name_usr']);?></option>
<?php
} while ($row_rsEmployeeLookup = mysql_fetch_assoc($rsEmployeeLookup));
$rows = mysql_num_rows($rsEmployeeLookup);
if($rows > 0) {
mysql_data_seek($rsEmployeeLookup, 0);
$row_rsEmployeeLookup = mysql_fetch_assoc($rsEmployeeLookup);
}
?>
</select>
</td>
</tr>
<tr>
<td>mobile phone</td>
<td><?php echo $row_rsEmployeeLookup['mobile_usr']; ?></td>
</tr>
etc.

 

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

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