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.

Empfohlene Antworten

Ich nehme an, du möchtest einfach mehrere Zeilen aus ner DB auslesen und diese dann innerhalb eines Templates ausgeben. Dafür würde ich das IT-Template-System von PEAR verwenden. Darin kannst du nämlich bestimmte Blocks definieren (auch verschachtelt):


<table>

	<tr>

		<th>Name</th>

		<th>Vorname</th>

		<th>Alter</th>

	</tr>

<!-- BEGIN Person -->

	<tr>

		<td>{name}</td>

		<td>{vorname}</td>

		<td>{alter}</td>

	</tr>

<!-- END Person -->

</table>

Wie du siehst, sind es nicht Prozentzeichen, sondern geschweifte Klammern, die die Variablen deklarieren. Im PHP-Script lädst, füllst und zeigst du dein Template wie folgt:


$tpl = new IntegratedTemplate('.');
$tpl->LoadTemplateFile('beispiel.html');

$h = mysql_query("SELECT * FROM personen") or die();
while ($result = mysql_fetchrow($h)) {
$tpl->setCurrentBlock("Person");
$tpl->setVariable("name",$result[1]);
$tpl->setVariable("vorname",$result[2]);
$tpl->setVariable("alter",$result[3]);
$tpl->parseCurrentBlock(); //Damit wird dieser Block mit
//den gerade gesetzten Variablen
//einmal geschrieben.
}
$tpl->show();
[/PHP]

Ich hoffe, das hilft.

ich kann dir nur empfehlen dich mit der template engine von http://smarty.php.net vertraut zu machen!

supportfragen dazu gibts in dem eigens dafür angelegten forum

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.