Kann die Daten in der DB nicht ändern.
erhalte immer Datensatz nicht gefunden.
index.php:
modify.php:
erhalte immer Datensatz nicht gefunden.
index.php:
PHP-Code:
<?php
//ANZAHL DER DATENSÄTZE
$num = mysql_numrows($result);
echo "</P>";echo "Anzahl Adressen: <b>$num</b>";echo"</p>";
echo "<form action='modify.php' method ='POST'>";
//DATENSÄTZE AUSLESEN.
$i = 0;
echo "<table border=1><tr id=title><td>Auswahl</td><td>ID</td><td>Club</td>
<td>Name</td><td>Vorname</td><td>Adresse</td><td>Ort</td><td>E-Mail</td><td>Telefon 1</td><td>Telefon 2</td></tr>";
while($i<$num) {
echo "<p>";
echo "<tr><td>";
echo "<input type='radio' name='auswahl' value='$id'>";echo "</td><td>";
echo mysql_result($result,$i,"id");echo "</td><td>";
echo mysql_result($result,$i,"club");echo "</td><td>";
echo mysql_result($result,$i,"name");echo "</td><td>";
echo mysql_result($result,$i,"vorname");echo "</td><td>";
echo mysql_result($result,$i,"adresse");echo "</td><td>";
echo mysql_result($result,$i,"ort");echo "</td><td>";
echo mysql_result($result,$i,"email");echo "</td><td>";
echo mysql_result($result,$i,"telefon1");echo "</td><td>";
echo mysql_result($result,$i,"telefon2");echo "</td></tr>";$i++;};
echo "</table>";
echo "<input type='submit' value='Datensatz anzeigen'>";
?>
PHP-Code:
<?php
if ($auswahl)
{
mysql_connect("***","***","***");
mysql_select_db("***");
$sql = "select * from jos_adressbuch where";
$sql .= " id = $auswahl";
$res = mysql_db_query(jos_adressbuch, $sql);
$old_club = mysql_result($res, 0, "club");
$old_name = mysql_result($res, 0, "name");
$old_vorname = mysql_result($res, 0, "vorname");
$old_adresse = mysql_result($res, 0, "adresse");
$old_ort = mysql_result($res, 0, "ort");
$old_email = mysql_result($res, 0, "email");
$old_telefon1= mysql_result($res, 0, "telefon1");
$old_telefon2 = mysql_result($res, 0, "telefon2");
echo "<b>Ändere die Daten:</b><br>";
echo "<FORM ACTION= 'sql/modify.php' METHOD= 'post'>";
echo "Club:<INPUT Name='new_club' value='$old_club'></INPUT>";
echo "Name:<INPUT Name='new_name' value='$old_name'></INPUT>";
echo "Vorname:<INPUT Name='new_vorname' value='$old_vorname'</INPUT>";
echo "Adresse:<INPUT Name='new_adresse' value='$old_adresse'></INPUT>";
echo "Ort:<INPUT Name='new_ort' value='$old_ort'></INPUT>";
echo "E-Mail:<INPUT Name='new_email' value='$old_email'></INPUT>";
echo "Telefon 1:<INPUT Name='new_telefon1' value='$old_telefon1'></INPUT>";
echo "Telefon 2:<INPUT Name='new_telefon2' value='$old_telefon2'></INPUT>";
echo "<input type='hidden' name'originalid' value='$auswahl'>";
echo "<INPUT TYPE=submit Value='ändern'>";
echo "<INPUT TYPE=reset Value='löschen'>";
echo "</form>";
}
else
echo "kein datensatz gefunden";
?>
Kommentar