Re: how does one bind a gui representation and a container object.

[email protected] (Fred Silsbee)
Newsgroups php.db,php.general
Message-ID <[email protected]>


--- On Thu, 1/8/09, Fred Silsbee <[email protected]> wrote:

> From: Fred Silsbee <[email protected]>
> Subject: how does one bind a gui representation and a container object.
> To: [email protected], [email protected]
> Date: Thursday, January 8, 2009, 10:41 PM
> I have a Qt 4.4 C++ SQL offline program that displays an SQL
> table.
> 
> When I change a row-column cell, the change is instantly
> reflected in the database. Under Qt 4.4 I use:
> 
> QSqlTableModel
> 
> How does one do this in PHP for online use.
> 
> I've done this under C#.NET VS2008 using
> "binding" between a gui representation and the
> container object.





error I get under Firefox 3.0.5 under Fedora 9 PHP 5.2.6
Unknown Renderer driver. Please specify an existing driver. 

Code:
<?php
require 'Structures/DataGrid.php';

// Instantiate the DataGrid
$datagrid =& new Structures_DataGrid();

// Setup your database connection
$options = array('dsn' => 'mysql://landon4:pwpwpwpwpw@localhost/landonx');

// Bind a basic SQL statement as datasource
$test = $datagrid->bind('SELECT * FROM log_book', $options);

// Print binding error if any
if (PEAR::isError($test)) {
    echo $test->getMessage();
}

// Print the DataGrid with the default renderer (HTML Table)
$test = $datagrid->render(Structures_DataGrid_Renderer_HTMLTable);

// Print rendering error if any
if (PEAR::isError($test)) {
    echo $test->getMessage();
}

?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.