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.

Html Mysql Und Php

Empfohlene Antworten

Veröffentlicht

Hi,

ich habe folgendes Problem. Ich habe eine mySQL Datenbank und möchte aus einer Spalte die Informationen in einer Select-Liste von Html haben,um dann eine Auswahl treffen zu können, die die ausgewählte Info in einen neuen table schreibt.

Wo und wie bette ich den PHP-Code mit der SELECT-Anweisung(SQL) in den Html-Code?

Danke

Da gibt's die verschiedensten Möglichkeiten! Um den PHP-Code etwas vom HTML zu trennen würde ich die Spalte per Select schon vorher auslesen lassen und dann in einer Schleife jede Option generieren und in eine Variable schreiben lassen:


$options .= "<option value=\"$variable1\" >$variable2</option>\n";
[/PHP]

Wenn die Schleife durch ist, kannst Du mit dem HTML-Code anfangen und an der Stelle der Select-Anweisung folgendes schreiben:

[PHP]
<select name="name">
<?php echo $options; ?>
</select>

Alles klar? :)

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.