fetchmode = DB_FETCHMODE_ASSOC; if ($book->error) { echo "Failure! Try again."; print_r($book->error); die; } if (isset($_REQUEST['op'])) { if ($_REQUEST['op']=="Save"){ $id = $book->nextID(); $cols_vals = array( /* var $col = array( 'id' => array('type' => 'integer', 'require' => true, 'qf_type'=>'hidden'), 'name' => array('type' => 'varchar', 'size' => 32, 'qf_label'=> 'Name (e.g. "John Smith")', 'qf_attrs'=> array('style'=>'background:#f00;')), 'address' => array('type' => 'clob', 'qf_type'=> 'textarea'), 'phone' => array('type' => 'varchar', 'size' => 32, 'qf_type'=>'text', 'qf_label'=> 'Phone number') , 'email' => array('type' => 'varchar', 'size' => 128, 'require' => true ,'qf_type'=>'text'), 'signdate' */ 'id' => $id, 'name' => mysql_real_escape_string($_REQUEST['name']), 'address' => mysql_real_escape_string($_REQUEST['address']), 'phone' => mysql_real_escape_string($_REQUEST['phone']), 'email' => mysql_real_escape_string($_REQUEST['email']), 'signdate' => date('Y-m-d') // Todays Date. ); $result = $book->insert($cols_vals); print_r($result); } // op = save } else { // display these following cols $cols = array( 'name', 'address', 'phone', 'email' /* // Default Date Detting 'signdate' => array( "Y" => date("Y"), "m" => date("m"), "d" => date("d") ) */ ); //print_r($cols);// double checking. //$form =& $book->getForm($cols); $form =& $book->getForm($cols); $form->addElement('submit', 'op', 'Save'); // add a "submit" button named "op" that says "Go!" $form->addElement('reset', '', 'Reset'); // add a reset button //phpinfo(32); $form->display(); $result = $book->select('list'); echo "
\n";
	foreach ($result as $id){
		print_r($id);
		echo "";

		foreach ($id as $content => $val){
			echo "";
		}	

		echo "\n";
	}	
	
	echo "
".$id."".nl2br($val)."
"; //$result = $book->selectResult('emails'); print_r($result); } ?>