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.

Probleme beim verändern von MySQL Datenbankeinträgen

Empfohlene Antworten

Veröffentlicht

Moin Leute!

Was ist an diesem Script falsch:

    $add = "    UPDATE  angebot

                SET     Datum               = '$mydatum',

                        Bild                = '$mybild',

                        Bezeichnung         = '$mybezeichnung',

                        Beschreibung        = '$mybeschreibung',

                        Preis               = '$mypreis',

                        von                 = '$myvon',

                        bis                 = '$mybis',

                        Lieferbedingungen   = '$mylieferbedingungen',

                        Aktiv               = '$myaktiv'

                WHERE   mydate = '$mydate';";

Mein Problem ist, dass keine Einträge verändert werden.

(Ja, ich bin mit der Datenbank korrekt verbunden und ja die Spalten-

und Variablennamen sind richtig geschrieben)

MfG

fr@ggy

Versuche es mal OHNE Semikolon in der SQL-Anweisung.

Vielleicht hast du in den Werten auch irgendwo ein einfaches Anführungszeichen drin stehen.

Was sagt denn die Fehlermeldung?

1. ohne Semikolon funktioniert das auch nicht...

2. Ne Fehlermeldung.... das wär schön.... aber mir wird vom mysql_query() eine 1 --> true zurückgeliefert. ausgeführt wirds trotzdem nicht.

nen update! der insert funktioniert.

ich hab grad was ganz verrüktes herausgefunden:

ich hab einen neuen Eintrag gemacht. DEN kann ich jetzt auch verändern.

Alle anderen Einträge nicht!

WAS SOLL SOWAS DENN?????? :eek:

mach doch mal einfach sowas:


$add = " UPDATE angebot.....";

echo $add;

[/php]

Das kopierst du dann und führst es z.B. im MySQLControlCenter aus. PHP liefert keine Fehlermeldungen wenn das SQL fehlerhaft ist, im ControlCenter siehst du sie aber.

DOH! Du hast recht!!!!!

:floet: Da hab ich wohl irgendwann mist gebaut......... :rolleyes:

THXXX 4 help

MfG

fr@ggy

wo war jetzt der fehler?

Manual sagt:

Only for SELECT,SHOW,EXPLAIN or DESCRIBE statements mysql_query() returns a resource identifier or FALSE if the query was not executed correctly. For other type of SQL statements, mysql_query() returns TRUE on success and FALSE on error. A non-FALSE return value means that the query was legal and could be executed by the server. It does not indicate anything about the number of rows affected or returned. It is perfectly possible for a query to succeed but affect no rows or return no rows.

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.