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.

MySQL "DELETE" in PHP

Empfohlene Antworten

Veröffentlicht

Hallo,

an dem folgende Script funktioniert irgend etwas nicht:

<?php

$id = $_REQUEST["id"];

$tabelle = $_REQUEST["tabelle"];

$seite = $_REQUEST["seite"];

$connID = mysql_connect ("localhost", "root", "");

mysql_select_db ("main", $connID);

$sql = ("DELETE FROM gaestebuch WHERE id='$id' ");

echo "$sql";

$result = mysql_db_query ($sql, $connID);

echo "$result";

/*

print "<script type='text/javascript'>

<!--

Frame2=eval('parent.main');

Frame2.location.href = '../../kommunikation/gaeste/gaeste.php';

//-->

</script>";*/

?>

Wäre super wenn mir jemand helfen könnte.

Gruß

NoGi

Auf den ersten Blick scheinen das Skript und die SQL-Löschabfrage korrekt zu sein. Allerdings hast du auch einige Infos "unterschlagen":

- Was funktioniert nicht (in Bezug zu deiner Erwartung)?

- Gibt es eine Fehlermeldung (wo/welche)?

- Was gibt mysql_error() aus?

- Wird der Datensatz wie gewünscht gelöscht?

Ansonsten noch ein Hinweis: Zahlen-Feldwerte sollten nicht in Hochkomma oder Anführungszeichen gesetzt werden. Aber das sollte hier nicht das Problem sein, weil's MySQL auch so kann.

Originally posted by NoGi

$result = mysql_db_query ($sql, $connID);

Hi,

die Funktion ist deprecated (veraltet) und hier auch noch falsch angewendet.

Näheres hier: http://www.php.net/manual/en/function.mysql-db-query.php

Benutze stattdessen:

mysql_query ($sql, $connID);

Gruß Jaraz

Thx, jetzt funktioniert es.

Gruß

NoGi

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.