Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Checkbox - database checkbox, if checked gives value of 1 .. how to sum ?

Reply
Thread Tools

Checkbox - database checkbox, if checked gives value of 1 .. how to sum ?

 
 
randy
Guest
Posts: n/a
 
      10-28-2003
Checkbox - field in database is defined as checkbox, name of field
"comp" , if checked gives value of 1 .. how to get the sum these
checked checkbox values. see page at
http://baseportal.com/cgi-bin/basepo...ch/testforperl.

here is the code i used

<do action=all>

<loop db=testforperl=perl>
$sum+=$_loop{"comp"};
</loop>

this does not work ... any suggestions...thanks
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      10-28-2003
(randy) wrote:
> Checkbox - field in database is defined as checkbox, name of field
> "comp" , if checked gives value of 1 .. how to get the sum these
> checked checkbox values. see page at
> http://baseportal.com/cgi-bin/basepo...ch/testforperl.
>
> here is the code i used
>
> <do action=all>
>
> <loop db=testforperl=perl>
> $sum+=$_loop{"comp"};
> </loop>
>
> this does not work ... any suggestions...thanks


Try posting a complete minimal example, what you expected it to do,
and what it in fact does. What you have posted appears to be a mixture
of some sort of XML and Perl; in any case, we can tell nothing from
it.

Also try using complete sentences: it make you much easier to
understand.

Ben

--
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ~ Jorge Luis Borges, 'The Babylon Lottery'
 
Reply With Quote
 
 
 
 
James Willmore
Guest
Posts: n/a
 
      10-28-2003
On 28 Oct 2003 10:25:26 -0800
(randy) wrote:

> Checkbox - field in database is defined as checkbox, name of field
> "comp" , if checked gives value of 1 .. how to get the sum these
> checked checkbox values. see page at
> http://baseportal.com/cgi-bin/basepo...ch/testforperl.
>
> here is the code i used
>
> <do action=all>
>
> <loop db=testforperl=perl>
> $sum+=$_loop{"comp"};
> </loop>
>
> this does not work ... any suggestions...thanks


Is this an application that _you_ wrote, or downloaded from the 'Net.

If it's one you downloaded - **contact the author**.

If this is a script/application _you_ wrote, please be a little more
specific. Is what you posted pesudo-code or what?

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Goldenstern's Rules: (1) Always hire a rich attorney (2) Never
buy from a rich salesman.
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      10-28-2003
randy <> wrote:

> here is the code i used
>
><do action=all>
>
><loop db=testforperl=perl>
> $sum+=$_loop{"comp"};
></loop>
>
> this does not work ... any suggestions



Yes, post to a newsgroup having to do with whatever language
you are using.

This newsgroup has to do with the Perl programming language,
and what you posted is not Perl.


--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas
 
Reply With Quote
 
randy
Guest
Posts: n/a
 
      10-29-2003
This is a Perl 5 Based Database . if you can ... Please go to
www.baseportal.com, and you can setup your own perl 5 based database
or create a page based in Perl 5.
So with that out of the way.... I created a database with a field
named "comp"
it is a checkbox type of field, i can not put it any other terms .
Also the field
has two default values: if checked = 1, if no check 0. That much works
good .
it displays in a page , as a colum and if checked has value of 1 in
the record that checked. Now at the bottom of that colum i would like
the total of the field
"comp".. to display the sum of all the records that have been checked.

I hope this helps... Thanks for all your help.

see page at http://baseportal.com/cgi-bin/basepo...ch/testforperl.


Has anyone looked at this Page? It might help you to understand the
structure of the output of the database.

Thanks Again..

Randy M.
 
Reply With Quote
 
James Willmore
Guest
Posts: n/a
 
      10-29-2003
On 29 Oct 2003 10:11:42 -0800
(randy) wrote:

> This is a Perl 5 Based Database . if you can ... Please go to
> www.baseportal.com, and you can setup your own perl 5 based database
> or create a page based in Perl 5.
> So with that out of the way.... I created a database with a field
> named "comp"
> it is a checkbox type of field, i can not put it any other terms .
> Also the field
> has two default values: if checked = 1, if no check 0. That much
> works good .
> it displays in a page , as a colum and if checked has value of 1 in
> the record that checked. Now at the bottom of that colum i would
> like the total of the field
> "comp".. to display the sum of all the records that have been
> checked.
>
> I hope this helps... Thanks for all your help.
>
> see page at
> http://baseportal.com/cgi-bin/basepo...ch/testforperl.
>
>
> Has anyone looked at this Page? It might help you to understand the
> structure of the output of the database.
>
> Thanks Again..


Please don't top post - it is rude

And, I did look at the URL you mentioned. *Contact the author*!
Since the author _may_ be able to help you.

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Sturgeon's Law: 9027777763302f everything is crud.

 
Reply With Quote
 
randy
Guest
Posts: n/a
 
      10-30-2003
I don't need you to tell me how to handle my messages. If I want to
top post. This is my choice. Who are you the Internet miss manners
police? If you can't help then don't post to this thread.
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      10-30-2003
randy wrote:
> If I want to top post. This is my choice.


On Usenet it's not. Your choice is: Either change attitude and comply
with the netiquette, or leave Usenet.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      10-30-2003
randy wrote:
> I don't need you to tell me how to handle my messages. If I want to
> top post. This is my choice.


Certainly. And it's everyone's else choice not to read you.

*PLONK*

jue


 
Reply With Quote
 
Michael Vilain
Guest
Posts: n/a
 
      10-30-2003
In article < >,
(randy) wrote:

> I don't need you to tell me how to handle my messages. If I want to
> top post. This is my choice. Who are you the Internet miss manners
> police? If you can't help then don't post to this thread.


Actually, you do. Someone has told you that you have BO. You've
decided to think of it as "natural" rather than shower and clean up.
And you wonder why people avoid you at parties and you haven't been laid
lately...

*Plonk*

--
DeeDee, don't press that button! DeeDee! NO! Dee...



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
CheckBox Checked=false when checked in DataList yurps ASP .Net 1 02-29-2008 01:08 PM
determining dynamic checkbox control's Checked value J ASP .Net 1 02-18-2008 08:11 AM
How to Bind Checked value of checkbox into sql Server database =?Utf-8?B?SGVtYW50?= ASP .Net 0 03-28-2007 12:09 AM
Set TextBox Value From Checked/unchecked Checkbox soprandi Java 0 11-29-2006 09:15 AM



Advertisments