Confudion Reigns - Clist Output Not performing As Expected
| From: | Martin Cameron | Date: | Fri, 23 Mar 2001 01:51:31 +0000 |
| Subject: | Confudion Reigns - Clist Output Not performing As Expected | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-1066@lists.php.net to get a copy of this message | ||
I haven't got a solution to the problem that I've beed harping on about
over the last 24 hours, but I need to move on. Here's the latest
problem. It allrevolves around using panes and passing values from one -
containing a text entry box - to another - which is a list generated
from a MySQL database, which is generated using the text entered in to
the text Entry box.
The problem that I have really mystifies me - I can get the appropriate
output to display on the console, but not in the List Box. The complete
listing and an image of the interface produced can be seen at
http://casablanca.thenet.co.nz/select.html.
The important part of the
script is:
$list= new GtkClist(3,$titles);
$sql="select * from statement where username =
'$username'";
$db = new DB_Sql;
$res=$db->query($sql);
$labelname=$username;
$list->clear();
$i=0;
$i=(int)$i;
while($row=mysql_fetch_array($res)){
$u=$row["username"];
$a=$row["amount"];
$d=$row["date"];
print $u."\t".$a."\t".$d."\n";
$labeltext[] .= $u;
$labeltext[] .= $a;
$labeltext[] .= $d;
$list->append($labeltext);
print $username."
<=========LOOP==============>".$labeltext[0]." <>
".$i."\n";
unset($labeltext);
$i++;
}
On the first iteration through, with username 'cameron' inserted, I get
this output:
cameron 67.50 2001-01-02
cameron <=========LOOP==============>cameron <> 0
cameron -45.00 2001-02-05
cameron <=========LOOP==============>cameron <> 1
cameron -100.00 2001-02-05
cameron <=========LOOP==============>cameron <> 2
CAMERON 0.00 2001-02-21
cameron <=========LOOP==============>CAMERON <> 3
cameron 0.00 2001-02-21
cameron <=========LOOP==============>cameron <> 4
cameron 0.00 2001-02-28
cameron <=========LOOP==============>cameron <> 5
cameron 0.00 2001-02-28
cameron <=========LOOP==============>cameron <> 6
cameron 1.96 2001-03-01
cameron <=========LOOP==============>cameron <> 7
cameron -10.00 2001-03-16
cameron <=========LOOP==============>cameron <> 8
And after I change the username to "cameronkids", I get the following
output (exactly as expected I might add):
cameronkids 0.00 2000-06-01
cameronkids <=========LOOP==============>cameronkids <> 0
cameronkids 67.50 2000-07-01
cameronkids <=========LOOP==============>cameronkids <> 1
cameronkids 0.00 2000-08-03
cameronkids <=========LOOP==============>cameronkids <> 2
cameronkids 0.00 2000-09-01
cameronkids <=========LOOP==============>cameronkids <> 3
cameronkids 0.00 2000-10-04
cameronkids <=========LOOP==============>cameronkids <> 4
cameronkids 0.00 2000-11-01
cameronkids <=========LOOP==============>cameronkids <> 5
cameronkids 0.00 2000-12-06
cameronkids <=========LOOP==============>cameronkids <> 6
cameronkids 0.00 2001-01-02
cameronkids <=========LOOP==============>cameronkids <> 7
cameronkids 0.00 2001-02-02
cameronkids <=========LOOP==============>cameronkids <> 8
cameronkids 0.00 2001-03-01
However, while the initial output goes to the interface, the second time
through - nothing in the interface, despite it getting to the console.
I would really appreciate any help that is forthcoming.
Regards
Martin Cameron