Login   Register  
PHP Classes
elePHPant
Icontem

File: sClassHTML/example/database/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Dario Mazzeo  >  sClassHTML  >  sClassHTML/example/database/index.php  >  Download  
File: sClassHTML/example/database/index.php
Role: Example script
Content type: text/plain
Description: Esempio per l'utilizzo dei database
Class: sClassHTML
Compose HTML pages programmatically
Author: By
Last change: aggiornato
Date: 6 years ago
Size: 716 bytes
 

Contents

Class file image Download
<?php
// esempio creazione tabella

// inclusione file
include (realpath(dirname(__FILE__).'../../../../sClassHTML/sClassHTML.php'));

// creazione pagina
$mypage = new sHtml("Pagina di prova");
$mypage->addCss("../../css/form.css");
$mypage->addCss("../../css/div.css");
$mypage->addCss("../../css/table.css");
$mypage->addCss("../../css/html.css");

// creazione della tabella da database
$conn=new sConnection();
$conn->setDb("database");
$conn->setQuery("select * from tabella");

$tb=new sTable("Esempio collegamento a DB");
$tb->addThead($conn->getTitle()); 
$tb->addBody($conn->getData());   
unset(
$conn);

// aggiunge la tabella alla pagina
$mypage->addObj($tb);

echo 
$mypage;
?>