Re: DB_DataObject_FormBuilder
| From: | Levan | Date: | Mon, 15 Dec 2003 09:47:45 +0000 |
| Subject: | Re: DB_DataObject_FormBuilder | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9518@lists.php.net to get a copy of this message | ||
Hi Markus!
My jorney to PEAR started. (My config :
win2k-pro/php4.33/apache1.3.20/MySQL3.23.57nt)
I have installed it and tried QuickForm. And it is working.
Than I have tried to use DB_DataObject.
I have created DataObjects and schema using CreateTable.php script.
Than I have taken the code from the PEAR/DB_DataObject manual:
<?
require_once 'DB/DataObject.php';
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$config = parse_ini_file('c:/phpdev/www/israelchat/myconfig.ini',TRUE);
$options = $config['DB_DataObject'];
$item = DB_DataObject::factory('items');
if ($item->get('id',1)) {
print_r($item);
}else{
echo "Could not found item #1";
}
?>
The raw with id=1 exists in table 'items' , but when I run the script it
Apache shows error message:
"Apache.exe generated errors and will be closed by Windows. You will need to
restart the program.
An error log is being created".
In error.log:
"
[Mon Dec 15 11:37:40 2003] [error] PHP Warning: unable to call
dataobjects_items::@ce() method in C:\php\pear\DB\DataObject.php on line
366
"
I have tried to run the script on MS IIS5.0. It just gives error HTTP 500
Internal server error.
Please help.
Thanks
Lev
"Markus Wolff" <wolff@21st.de> wrote in message
news:3FDC6571.7040202@21st.de...
> Levan wrote:
> > I am fresh user of PEAR. Can anyone send me a full example on how to use
> > DB_DataObject_FormBuilder to build html form based on db tables data and
to
> > process than 'insert', 'update' commands? In other words could anybody
give
> > the pattern of using DB_DataObject_FormBuilder?
>
> Hi Lev,
>
> first of all, you should familiarize yourself with the basic usage of
> DB_DataObject and HTML_QuickForm. FormBuilder does not completely free
> you from having to know how these packages work, it just makes it easier
> to use them together to quickly produce working applications.
>
> I would recommend to first take a look at how QuickForm works:
>
> http://pear.php.net/manual/en/package.html.html-quickform.php
>
> Then, familiarize yourself with DB_DataObject, and generate the class
> files for your database:
>
>
> http://pear.php.net/manual/en/package.database.db-dataobject.php
>
> Finally, study the FormBuilder example to see how it can aid you in
> rapid prototyping of database-driven applications:
>
>
> http://cvs.php.net/cvs.php/pear/DB_DataObject_FormBuilder/examples/
>
> HTH,
> Markus