PHP-GTP: how insert data from mysql in GtkCList

From: Date: Sun, 20 Apr 2003 22:57:09 +0000
Subject: PHP-GTP: how insert data from mysql in GtkCList
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3252@lists.php.net to get a copy of this message
>Ho trovato un esempio fatto con PostGre ma non riesco a modificarlo, potete >aiutarmi? Penso che possa interessare. U can see an example of data-accessing with PostGre. Please can u help me to convert the demo for mysql? I think that this demo may be useful for the whole community. <?php if (!class_exists('gtk')) { dl('php_gtk.so'); dl('pgsql.so'); } function shutup() { gtk::main_quit(); } $connect=pg_connect("user=xxx dbname=xxx"); $result=pg_exec("select name,firstname from namelist"); $window = &new GtkWindow(); $scroll= &new GtkScrolledWindow(); $clist = &new GtkCList(2,array("Name","Last Name")); for($i=0;$i<$numrows=pg_numrows($result);++$i) { $row[$i]=pg_fetch_row($result,$i); } /*The row array is filled so that we can use the foreach style, which is usefull here*/ foreach ($row as $app) $clist->append($app); /* $app[0] = $row[$i][0] $app[1] = $row[$i][1] That's what append wants */ /*Just for the output */ $clist->set_column_min_width(0, 100); $clist->set_column_min_width(1, 100); $clist->columns_autosize(); $scroll->add($clist); $window->set_default_size(400,800); $window->add($scroll); $window->connect("destroy","shutup"); $window->show_all(); gtk::main(); ?> bye andy

« previous php.gtk.general (#3252) next »