<?php
include "class.genpo.php";
/*
CREATE TABLE IF NOT EXISTS `compinfo` (
`id` bigint(20) NOT NULL auto_increment,
`mylink` varchar(100) NOT NULL,
`compname` varchar(500) default NULL,
`address` varchar(100) default NULL,
`post` varchar(100) default NULL,
`email` varchar(100) default NULL,
`phone` varchar(500) default NULL,
`zip` varchar(100) default NULL,
`memo` varchar(100) default NULL,
`intime` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=636 ;
*/
$dbserver="localhost";
$dbuser="annie";
$dbpass="annie";
$link=mysql_connect($dbserver,$dbuser, $dbpass);
$dbname="annie";
$tablename="compinfo";
$fields = mysql_list_fields ( $dbname , $tablename , $link );
$columns = mysql_num_fields ( $fields );
$fieldnames = array();
for ( $i = 0 ; $i < $columns ; $i ++) {
$fieldnames[]= mysql_field_name ( $fields , $i ) ;
}
$g = new genpo($tablename,$fieldnames);
echo "<textarea rows=100 cols=100>";
echo $g->genpo() ;
echo "</textarea>";
?>
|