Login   Register  
PHP Classes
elePHPant
Icontem

File: csa_db_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Roberto Andrade Fonseca  >  Cascade Select Associative  >  csa_db_example.php  >  Download  
File: csa_db_example.php
Role: Example script
Content type: text/plain
Description: Database example from two related tables in a RDBMS
Class: Cascade Select Associative
Generate two dependent HTML form select inputs
Author: By
Last change:
Date: 2005-02-08 18:33
Size: 985 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<h2>Using cascadeSelectAssoc with PostgreSQL Database</h2>
<?php
include("cascadeSelectAssoc.php"); 
include(
"pgsqlCascadeSelectAssoc.php"); 
$mothersData getMotherData("localhost","postgres","","csa_test_db","mothers","id_mother","mother","mothers");
$childrenData getChildData("localhost""postgres""""csa_test_db""children","id_mother""id_child""child");

$o=new cascadeSelectAssoc("testForm");
$o->setName("id_mother","id_child");
$o->setHeight();
$o->setData($mothersData,$childrenData);
$o->writeScript();
?>
<form name="testForm" method="post">
<table border=0 cellpadding=2 cellspacing = 2>
<tr>
    <tr align=center>
        <td>Types</td>
    </tr>
    <tr>
        <td><?php $o->drawMother(); ?> </td>
    </tr>
    <tr align=center>
        <td>Tools</td>
    </tr>
    <tr>
        <td><?php $o->drawChild("sel"); ?> </td>
    </tr>
    <tr>
    <td>
    <input type="submit" value="Go">
    </td>
    </tr>
</table>