[Fwd: Re: [PHP-GTK] please help-edit sql output]
| From: | tony g | Date: | Mon, 18 Nov 2002 02:21:35 +0000 |
| Subject: | [Fwd: Re: [PHP-GTK] please help-edit sql output] | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2661@lists.php.net to get a copy of this message | ||
hi and thanks, i have made a clist as shown below, now to make it editable.
tony
$titles = array(" name ", " age "," gender ");
$clist = &new GtkCList(3,$titles);
$scrolledwindow->add_with_viewport($clist);
$clist->show();
while($row = mysql_fetch_array($result))
{
// Create a string array $pLista=array($row["name"],$row["age"],$row["sex"]);
$row = $clist->prepend($pLista);
}
-------- Original Message --------
Subject: Re: [PHP-GTK] please help-edit sql output
Date: Mon, 18 Nov 2002 02:01:32 -0000
From: "Steph" <sfox@php.net>
Reply-To: "Steph" <sfox@php.net>
To: "tony g" <kamigwi@netscape.net>, "PHP GTK" <php-gtk-general@lists.php.net>
References: <3DD84309.9040609@netscape.net>
Tony, hi -
Play with GtkCList. I'm afraid it's still not documented, but if you
look at gtk.defs in the PHP-GTK source you'll find all its methods
there.
----- Original Message -----
From: "tony g" To: "PHP GTK" Sent: Monday, November 18, 2002 1:31 AM
Subject: [PHP-GTK] please help-edit sql output
hi , new at php-gtk, but enjoying it, and making some progress my question is, is there anyway of making the output from mysql editable, maybe for later update after changing some values? i am reading the manual and experimenting abit but so far no luck. please help thanks tony create table biodata ( name text, age int, gender text); $extension = "php_gtk" . (strpos(PHP_OS, "WIN") >= 0 ? ".dll" : ".so");
dl($extension); $window = &new GtkWindow(); $window->set_title("Test App"); $window->set_default_size(500, 300); $window->connect_object('destroy',array('gtk', 'main_quit')); $box = &new GtkVBox(); $window->add($box); $button = &new GtkButton("Connect and Get Rows"); $button->connect("clicked", "getdata"); $box->pack_start($button); function getdata() { global $window; global $button; global $box; global $pList;$button->hide(); $s = mysql_connect("","","") or die("Couldn't connect to databaseserver"); $d = mysql_select_db("personnel", $s); $result = mysql_query("select * from biodata where name = 'john'");while($row = mysql_fetch_array($result)){$pList .= "Name " . $row[1] . "\n". "Age " . $row["age"] . "\n" . "Gender " .$row["sex"] . "\n";} $p = &new GtkLabel("$pList"); $box->add($p); $p->show(); } $window->show_all(); gtk::main(); -- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php