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.

php Mysql Ausgabenformatierungs Prob.

Empfohlene Antworten

Veröffentlicht

Hi !

Da ich jetzt im Praktikum völliges Neuland mit php betrete habe ich ein im moment für mich unlösbar scheinendes Problem

Also ich habe eine Daten bank mit vielen Feldern in einer Tabelle und die Datensätze sind über Id (als Key und autowert definiert) unterschieden das ganze frage ich jetzt über php ab, die Ausgabe klappt auch aber wie bekomme ich diese jetzt so Formatiert das die datensätze hübsch untereinander kommen ?? Sollen nacher evtl als Link dienen um ein anderes Formular aufzurufen und da sieht das mit neuer Zeile pro Feld nicht so aus finde ich !

Über hilfe würde ich mich echt freuen !!!!

Hier mal mein Text:

<?php

$db_server = "127.0.0.1";

$db_name = "inventur";

$db_user = "root";

$db_passwort = "";

$db = MYSQL_CONNECT($db_server,$db_user,$db_passwort) or die ("Fehler 1 Keine Verbindung zum Server gefunden");

MYSQL_SELECT_DB( $db_name,$db) or die ("Fehler 1 Keine Verbindung zum Server gefunden");

?>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body bgcolor="#FFFFFF" text="#000000">

<?php

$result = mysql_query("SELECT * FROM inventar WHERE art = '$art' ORDER BY id");

echo mysql_error();

while($row = mysql_fetch_row($result)){

$anzahl = count($row);

for($i=0;$i<=$anzahl-1;$i++){

echo $row[$i] . "<br>\n";

}

}

?>

Hi,

du kannst die Datensätze in eine Tabelle packen, wobei dann für einen Datensatz jeweils eine Zeile ist.


echo "<table>";

while($row = mysql_fetch_row($result)){

  echo "<tr>";

  $anzahl = count($row);

  for($i=0;$i<=$anzahl-1;$i++){

    echo "<td>".$row[$i]."</td>";

  }

  echo "</tr>\n";

}

echo "</table>";

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.