Jo: html-Datei aus Datenbank erzeugen

Beitrag lesen

Haloo,

ich möchte das Ergebnis einer einfachen Datenbankabfrage nach der Ausführung auf dem Server direkt als statische Html-Seite abspeichern:
Der Code der PHP-Datei sieht z.B. so aus:

<?php
//Connection statement
require_once('Connections/dsn.php');

// begin Recordset
$query_Recordset1 = "SELECT NAME, LINK FROM LAYER";
$Recordset1 = $phpmapscriptdsn->SelectLimit($query_Recordset1) or die($phpmapscriptdsn->ErrorMsg());
$totalRows_Recordset1 = $Recordset1->RecordCount();
// end Recordset
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php?>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td>Name</td>
    <td>Link</td>
  </tr>
  <?php
  while (!$Recordset1->EOF) {
?>
  <tr>
    <td><?php echo $Recordset1->Fields('NAME'); ?></td>
    <td><?php echo $Recordset1->Fields('LINK'); ?></td>
  </tr>
  <?php
    $Recordset1->MoveNext();
  }
?>
</table>
</body>
</html>