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

Discussion in 'Perl Misc' started by randy, Oct 28, 2003.

  1. randy

    randy Guest

    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
    randy, Oct 28, 2003
    #1
    1. Advertising

  2. randy

    Ben Morrow Guest

    (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/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

    --
    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'
    Ben Morrow, Oct 28, 2003
    #2
    1. Advertising

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

    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/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.
    James Willmore, Oct 28, 2003
    #3
  4. 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
    Tad McClellan, Oct 28, 2003
    #4
  5. randy

    randy Guest

    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.
    randy, Oct 29, 2003
    #5
  6. Re: Checkbox - database checkbox, if checked gives value of 1 ..how to sum ?

    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/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.
    James Willmore, Oct 29, 2003
    #6
  7. randy

    randy Guest

    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.
    randy, Oct 30, 2003
    #7
  8. Re: Checkbox - database checkbox, if checked gives value of 1 ..how to sum ?

    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
    Gunnar Hjalmarsson, Oct 30, 2003
    #8
  9. 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
    Jürgen Exner, Oct 30, 2003
    #9
  10. 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...
    Michael Vilain, Oct 30, 2003
    #10
  11. (randy) wrote in message news:<>...
    > 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)
    James Willmore, Oct 30, 2003
    #11
  12. randy

    Ben Morrow Guest

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


    *PLONK*

    Getting the idea yet?

    --
    Musica Dei donum optimi, trahit homines, trahit deos. |
    Musica truces molit animos, tristesque mentes erigit. |
    Musica vel ipsas arbores et horridas movet feras. |
    Ben Morrow, Oct 30, 2003
    #12
  13. randy

    Anno Siegel Guest

    randy <> wrote in comp.lang.perl.misc:
    > 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
    Anno Siegel, Oct 31, 2003
    #13
  14. randy <> wrote:

    > If I want to
    > top post. This is my choice.



    So long then.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Nov 1, 2003
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yurps
    Replies:
    1
    Views:
    6,881
    rajeshthangarasu1983
    Feb 29, 2008
  2. soprandi
    Replies:
    0
    Views:
    1,159
    soprandi
    Nov 29, 2006
  3. Oliver Block

    valarray.sum() gives unclean results

    Oliver Block, Nov 16, 2005, in forum: C++
    Replies:
    3
    Views:
    337
    Oliver Block
    Nov 16, 2005
  4. =?Utf-8?B?SGVtYW50?=
    Replies:
    0
    Views:
    468
    =?Utf-8?B?SGVtYW50?=
    Mar 28, 2007
  5. J
    Replies:
    1
    Views:
    517
    Masudur
    Feb 18, 2008
Loading...

Share This Page