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.

Problem beim Zugriff auf DB

Empfohlene Antworten

Veröffentlicht

Hallo, ich versuche mir anzulernen wie ich eine Verbindung von php zur mysql DB herstelle. Eine DB hab ich schon die heist kontakte. Wer kann mir sagen was bei meinem Code falsch ist. <?php

$dbconn = mysql_connect("localhost", "markus", "123")

or die ("keine Verbindung zum DB-Server");

$db = "kontakte";

$dbquery = "SELECT * FROM gaeste"

$result = mysql_db_query("kontakte", "query", "dbconn") or die ("Fehler bei der Anfrage");

echo "<table border=1>";

while ($name = mysql_fetch_arry($result))

{

echo "<tr>";

foreach($zeile as $element)

{

echo "<td>$element</td>";

}

echo "</tr>";

}

echo "</table>";

?>

Danke.

Hallo,

erst einmal zu mysql_db_query:

Note: This function has been deprecated since PHP 4.0.6. Do not use this function. Use mysql_select_db() and mysql_query() instead.

Dann holst du dir mit:

while ($name = mysql_fetch_arry($result))

das Array $name, arbeitest aber mit $zeile und $element weiter.

Das kann so nicht gehen.

Am besten ist, man nimmt sich ein Beispiel aus der aktuellen PHP Doku und passt das an.

http://www.php.net/manual/de/function.mysql-fetch-array.php

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.