Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

Count and show number of records from loged in user

Quote Reply
Count and show number of records from loged in user
Hi,
I use the following global to look from one of my tables the records of loged in user and format the result in a table inside a table within a form, and this works very well.
Now I need to show some where in my page the number of these records as a digit . Does any one has an idea how I would count the result within my global or use another global to get this number.
Please if you have any suggestion , reply to this post.
Thank you

My global:

sub {
my $tags = shift;
my $output;
my $loged_user = $tags->{Username};
my $table = $DB->table('mydb');
my $sth = $table->select (['colum1', 'colum2' ,'colum3','colum4','colum5','colum6'], {'owner' => $tags->{Username} } );
while (my $row = $sth->fetchrow_hashref) {
($output .= "<table width=595 border=0 cellspacing=1 cellpadding=0><tr bgcolor=#FFFFFF><td class=text2 width=20><input type=radio name=column1's name value=");
($output .= "$row->{colum1} ");
($output .= "></td><td class=title2 width=200>");
($output .= "$row->{colum1}");
($output .= "</td><td class=text2 align=center width=60>");
($output .= "\$");
($output .= "$row->{colum2}");
($output .= "</td><td class=text2 align=center width=60>");
($output .= "\$");
($output .= "$row->{colum3}");
($output .= "</td><td class=text2 align=center width=70>");
($output .= "$row->{colum4}");
($output .= "MB");
($output .= "</td><td class=text2 align=center width=75>");
($output .= "$row->{colum5}");
($output .= " GB");
($output .= "</td><td class=text2 align=center>");
($output .= "$row->{colum6}");
($output .= "</td></tr></table>");
}
return $output;
}
Ali
Subject Author Views Date
Thread Count and show number of records from loged in user megaline 4747 Jul 6, 2004, 8:09 AM
Thread Re: [megaline] Count and show number of records from loged in user
604 4666 Jul 7, 2004, 3:50 PM
Post Re: [TheStone] Count and show number of records from loged in user
megaline 4644 Jul 8, 2004, 9:17 AM