code zur erzeugung des listenfelds(hab ich gefunden), deswegen wär ne genauere Erklärung cool.
weiter unten dann meine Anwendung:
und folgender Fehler:
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in d:\programme\apache group\apache\htdocs\bibli\input.php on line 104
und
mysql_fetch_row(): supplied argument is not a valid MySQL result resource in <b>d:\programme\apache group\apache\htdocs\bibli\input.php</b> on line <b>98</b><br />
Grüße,
Matthias
PHP-Code:
// builds a selection list for a form --------------------------
// formname: name of the select list
// sql: contains SELECT query; the first parameter has to be ID,
// the second one the name
function build_select_list($formname, $sql, $defaultitem) {
$result = mysql_query($sql);
echo '<select name="', $formname, '" size=1>';
echo '<option value="none">(wähle)';
while($row=mysql_fetch_row($result)) {
echo "<option ";
if($defaultitem==$row[0]) echo "selected ";
echo "value=\"$row[0]\"> ", htmlentities($row[1]), "\n";
}
echo "</select>\n";
mysql_free_result($result);
}
PHP-Code:
<tr><td>Standort:
<td><?php build_select_list("formStandort",
"SELECT userID,name,vorname FROM Standort".
"ORDER BY name",$formStandort); ?></tr>
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in d:\programme\apache group\apache\htdocs\bibli\input.php on line 104
und
mysql_fetch_row(): supplied argument is not a valid MySQL result resource in <b>d:\programme\apache group\apache\htdocs\bibli\input.php</b> on line <b>98</b><br />
Grüße,
Matthias
Kommentar