Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

UPDATE geht nicht

Empfohlene Antworten

Veröffentlicht

Moin,

wieso funzt folgendes nich:


$benutzer = "xxx";

$passwort = "xxx";

$db = "xxx";

$host ="xxx";

    $link =  mysql_pconnect( $host, $benutzer, $passwort );

if ( ! $link )

    die( "Keine Verbindung zu MySQL" );

mysql_select_db( $db, $link ) 

    or die ( "Konnte Datenbank \"$db\" nicht öffnen: ".mysql_error() );

	if ( isset( $neu_interpret ) && isset( $neu_titel ) && isset( $song_id ) )

    {	

    $anfrage = "UPDATE songs SET interpret='$neu_interpret', titel='$neu_titel' WHERE id=$song_id";

    $ergebnis = mysql_query( $anfrage );

    if ( ! $ergebnis )

        die ("Änderung fehlgeschlagen: ".mysql_error());

    print "<small>Erfolgreich geändert: ".mysql_affected_rows(). 

    " Datensätze/Datensatz geändert</small><p>";

    }

$ergebnis = mysql_query( "SELECT * FROM songs ORDER BY id" );



echo('<small><b>Songs ändern:</b></small>');

echo('<form action="'.$PHP_SELF.'" method="POST">');

while ( $datensatz = mysql_fetch_array( $ergebnis ) )

	{

	echo('<input type="text" size="5" CLASS="Eingabe" name="song_id" value="'.$datensatz[id].'">   <input type="text" name="neu_interpret" size="25" CLASS="Eingabe" value="'.$datensatz[interpret].'">   <input type="text" name="neu_titel" size="25" CLASS="Eingabe" value="'.$datensatz[titel].'"><br>');

	}


echo('<br>');

echo('<input type="submit" class="Button" value="  ok!  "></form>');

mysql_close( $link );

?>

ich hab zuvor noch nie mit der update funktion gearbeitet, daher können schon fehler vorhanden sein, jedoch geht das ganze, wenn ich statt den x*2 nur 1 feld ändern will.

es ändert z.b. auch nur die unterste ausgabe, und der rest wird komplett überschrieben. muss ich das irgendwie anders mit der id ordnen?

für hilfe wäre ich dankbar :)

Was für eine Fehlermeldung bekommst du denn ?

gar keine. Mir zeigts ganz normal die id - interpret - titel an. wenn i dann aber eins ändern, überschreibts mir alle mit dem text aus dem der letzten zelle.

[ id ] [ interpret ] [ titel ]

[ id ] [ interpret ] [ titel ]

[ id ] [ interpret ] [ titel ]

[ id ] [ interpret ] [ titel ]

[ ok ]

so schauts aus..

i hab den verdacht, dass es das mit der id nicht richtig ausführt. also statt der speziellen id, es mit jeder id ausführt

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.