hi,
habe ein kleines problem mit der update funktion..und ich sehe de fehler nicht...naja...ist auf drei files aufgeteilt - file1 [id-reihe zum edit aussuchen] --> file2 zeigt alten text und edit für neuen --> file3 schreibt die daten in di db--tab...
(1)
(2)
(3)
thx
cya
habe ein kleines problem mit der update funktion..und ich sehe de fehler nicht...naja...ist auf drei files aufgeteilt - file1 [id-reihe zum edit aussuchen] --> file2 zeigt alten text und edit für neuen --> file3 schreibt die daten in di db--tab...
(1)
PHP-Code:
<form method="POST" action="update.php">
[b]
ID[/B]<input type="text" name="idc" size="10">
<input type="submit" value="update" name="B1"></p></p>
</form>
<?php
include("connection.php");
$display_user = true;
if ( $display_user ) {
print "<table border=\"0\" bgcolor=#C0C0C0 width=850>";
print "</td><td width=51 valign=top colspan=\"1\">";
print "[b]ID[/b]";
print "</td><td width=800 valign=top colspan=\"1\">";
print "[b]Werbetexte[/b]";
print "</td></table>";
$abfrage = "SELECT id, signatur from $tab3 ORDER BY `id` ASC";
$erg = mysql_db_query("$dbname",$abfrage,$link);
while (list($id, $signatur) = mysql_fetch_row($erg)) {
print "<table border=\"0\">";
print "<td width=50 valign=top >$id</td><td width=800 valign=top >$signatur</td></table>"; } }
?>
PHP-Code:
<?php
include("connection.php");
$display_user = true;
if ( $display_user ) {
print "
[b]WERBETEXT[/b]
";
$abfrage = "SELECT * from $tab3 where id=$idc";
$erg = mysql_db_query("$dbname",$abfrage,$link);
while (list($id, $signatur) = mysql_fetch_row($erg)) {
print "$signatur"; } }
?>
<hr>
<form method="POST" action="update2.php">
[b]neuer Text[/B]
<textarea rows="5" name="newtxt" cols="30"></textarea>
<input type="submit" value="updaten" name="B1"></p>
</form>
PHP-Code:
<?php
include("connection.php");
$schreiben = "update $tab3 set signatur='$_REQUEST[newtxt]' where id='$idc'";
$test = mysql_db_query("$dbname", $schreiben, $link);
if($test) { echo "Erfolgreich"; }
else { echo "Fehler"; }
if ( ! mysql_query( $query, $link ) )
{ $dberror = mysql_error(); return false; }
return true;
echo "
Text wurde upgedated";
echo "
$newtxt";
?>
cya
Kommentar