Fw: Re[6]: [PHP-GTK] simple mysql
| From: | Steph | Date: | Thu, 29 Mar 2001 18:09:36 +0000 |
| Subject: | Fw: Re[6]: [PHP-GTK] simple mysql | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-1199@lists.php.net to get a copy of this message | ||
Thanks everyone, Adam's version works :)
(see below)
----- Original Message -----
From: "Adam Rambousek" <rambousek@volny.cz>
To: "Steph" <steph.fox@btinternet.com>
Sent: Thursday, March 29, 2001 6:23 PM
Subject: Re[6]: [PHP-GTK] simple mysql
well, for me it was a new problem; and I like solving new problems :)
I've rewritten your function a bit
$selection returns array with the selected rows' numbers
you have to use get_text(row,column) to data and then you could do anything with
the text
function save_selection(){
global $clist;
$clist->freeze();
$selection = $clist->selection;
$write = fopen('something.txt', 'w');
for ($i=0;$i<count($selection);$i++) {
$row_nr=$selection[$i];
$row_data[0]=$clist->get_text($row_nr,0);
$row_data[1]=$clist->get_text($row_nr,1);
$row_data[2]=$clist->get_text($row_nr,2);
$row=$row_data[0].";".$row_data[1].";".$row_data[2]."\n";
fputs($write,$row);
}
fclose($write);
$clist->thaw();
focusback();
}
--
Adam Rambousek
email: rambousek@volny.cz PGP KeyID: 33BD6BAE ICQ: 47596279
www: http://adamovy.cestiny.cz http://werich.poda.cz http://rambousek.com