Originariamente inviato da bstefano79
cosa è getEditor () ????
una funzione che interroga il db.
cmq ho fatto una correzione:
Codice PHP:
<select name="txtEditor">
<option value="*">*</option>
<?php
foreach (getEditor () as $rowEditor) {
$select;
If ($rowEditor['editor_name'] == $_GET['e']) {
$selected = "selected='selected'";
}
echo "<option value='" . $rowEditor['editor_id'] . "' $selected >" . $rowEditor['editor_name'] . "</option>";
}
?>
</select>
adesso mi riempie tutta la lista ma seleziona sempre l'ultima voce.
la funzione che uso per interrogare il db è questa:
Codice PHP:
public function getEditor() {
$result = array();
try {
$result = $this->pdo->query("CALL getEditor()");
return $result;
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "
";
die();
}
}