Re: Here's a DB example (fwd)
| From: | tarique@sanisoft.com | Date: | Thu, 15 Mar 2001 09:07:33 +0000 |
| Subject: | Re: Here's a DB example (fwd) | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-910@lists.php.net to get a copy of this message | ||
Martin
Can't seem to reach your server
See solution to DB example below
Tarique
--
=========================================
B2B Application Providers
http://www.sanisoft.com
Vortal for Nagpur http://nagpurcity.net
=========================================
---------- Forwarded message ----------
Date: Thu, 15 Mar 2001 14:32:11 +0530 (IST)
From: "tarique@sanisoft.com" <tarique@sanisoft.com>
To: Martin Cameron <cameron@cameron.co.nz>
Cc: php-gtk@lists.php.net
Subject: Re: [PHP-GTK] Here's a DB example
On Fri, 16 Mar 2001, Martin Cameron wrote:
Martin,
the non functioning of your example has nothing to do with gtk.
Rather it is due to your mixing to PHP and PHPlib db access functions
The "ret_data" function is should read like this:
>
function ret_data(){
global $label, $entry, $db, $button1, $button2;
$username=$entry->get_text();
$label->set_text("Connecting to database");
$sql="select * from statement where username = '$username'";
$res=$db->query($sql);
//The query for the default username returns nine rows.
while($db->next_record( )){
$l= ("Username: ".$db-f("username").":: Amount:
".$db-f("amount")." :: Date:".$db-f("date")."
.\n");
//print to the console, the returned value.
print $l;
//This line only returns the last entry. It doesn't concatenate
each entry as it does for the console.
$label->set_text($l);
}
}
See documentation for PHPlib on phplib.netuse.de
Hope this solves your problem
Tarique
--
=========================================
B2B Application Providers
http://www.sanisoft.com
Vortal for Nagpur http://nagpurcity.net
=========================================