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 wert löschen (gleich in mehreren tb)

Empfohlene Antworten

Veröffentlicht

hi,

undzwar habe ich folgendes problem

angenommen ich habe 6 tabellen.

jede tb hat unterschiedliche anzahl von spalten und zeilen sowie unterschiedliche namen.

angenommen, in den 6 tb steht jetzt irgendwo z.B. der wert "testvari" drin, kann ich das dann irgendwie löschen?

hier beispiel:

tb_1:

id | name | farbe

1 my testvari

tb_2:

id | session | gruppe

1 d8236z red testvari blue

ich will also nur den wert "testvari" aus allen tb löschen.

bloß wie?

Also ich ahb jetzt grad keine PHP zum ausprobieren aber so könnte es gehen:


<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');

$table="Tabelle";
$fields = mysql_list_fields("database1", "$table", $link);
$columns = mysql_num_fields($fields);

for ($i = 0; $i < $columns; $i++) {
mysql_query("update $table set " . $fields[$i] . " = AndererWert where " . $field[$i] . " =testvari");
} ?>
[/PHP]

Hi,

das geht nur, wenn du:

-InnoDB Tabellen in Mysql benutzt.

-Die Spalten in dem der Name vorkommen kann als Foreign Keys in den Tabellen deklarierst.

-Als Update Option "cascade on delete" setzt.

Näheres dazu hier: http://www.mysql.com/doc/en/SEC447.html

Gruß Jaraz

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.