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

B

Ben Morrow

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/baseportal.pl?htx=/searsdvdtech/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
 
J

James Willmore

On 28 Oct 2003 10:25:26 -0800
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/baseportal.pl?htx=/searsdvdtech/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.
 
T

Tad McClellan

randy said:
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.
 
R

randy

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/baseportal.pl?htx=/searsdvdtech/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.
 
J

James Willmore

On 29 Oct 2003 10:11:42 -0800
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/baseportal.pl?htx=/searsdvdtech/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.
 
R

randy

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.
 
G

Gunnar Hjalmarsson

randy said:
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.
 
J

Jürgen Exner

randy said:
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
 
M

Michael Vilain

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*
 
J

James Willmore

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.

No. However, there are posting guidelines for this group.
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
(reference "Use an effective followup style" section)

And if you don't have a _specific_ question about programming in Perl
(meaning, something _you_ wrote, not some application you downloaded
from the 'Net and want support for), don't post.

Case closed. Have a nice day :)

Jim
(jwillmore _at_ adelphia _dot_ net)
 
B

Ben Morrow

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.

*PLONK*

Getting the idea yet?
 
A

Anno Siegel

randy said:
I don't need you to tell me how to handle my messages. If I want to
top post. This is my choice.

Absolutely. So long.
Who are you the Internet miss manners
police? If you can't help then don't post to this thread.

Hypocrite.

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top