When you do your query, are you retrieving all of the values based upon some external criteria? If so, then you will have one row with each field in that row for each form element.
Standard rule of thumb (and coding requirements that I set up) is that the form element name should be identical to the resultset row:
class MySQLQuery {
/**
* Retrieve resultset as an array of objects set up by mysql_fetch_object() PHP function
*
* @access public
* @return object $result
*/
function getResult() { // OBJECT METHOD
$runquery = $this->runQuery();
$count = 0;
while ($row = mysql_fetch_object($runquery)) {
$result[$count] = $row;
$count++;
}
return $result;
}
}
$query = new MySQLQuery('SELECT * FROM blah', $this->dbAP->getDBConn());
$result = $query->getResult();
// NOW YOU HAVE A SINGLE RESULTSET ROW, A SINGLE-ELEMENT ARRAY OF OBJECTS
?>
<input name="first_name" size="30" maxlength="75" value="<?= str_replace('"', '"', str_replace('\\', '', $result[0]->first_name)) ?>">
That would be a sample of how you could handle this.
HTH
Phil