baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from Qasem Alsaleh on 1/2 2004, 20:17 +00:00
    EMail: qalsaleh@hotmail.com

    How to hide all data when a blank Search entry is used?


      I also need to hide all the data on my website, and I have used the previously suggested solution of TheOneRing: "<do action=all selectbrowse=no details=no ..etc" keeping the Search option available, and it is working but the problem is when using "search" with a blank entry, then All data will be available to the user !
      How to prevent result of a blank search from being available to the user?


      Qasem Alsaleh

    Your reply:

    Name: EMail: WWW:
    Subject:
    Text:
    Timezone:

    Post a new message


 All messages from this thread: To the list 
    Message from TheOneRing on 1/3 2004, 05:53 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    Really need help here - perl


      I need to sum the total of a field IF it meets certain criteria. My database looks a bit like this:

      Title (field) Chapter (field) Size (field)
      My Life .......... 1 ................ 5
      My Life .......... 2 ................10
      My Life .......... 3 ................ 8
      The Revenge.....1 ..............30
      The Suspect.....1 ..............10
      The Suspect.....2 ..............20

      I need to sum the field "Size" IF the field "Title" is the same story title. But, obviously I don't want to query the actual field value...too many entries. So I have to use variable names like $Title and $Size.

      In the example above, my sums should be:
      For
        My Life Sum=23
        The Revenge Sum=30
        The Suspect Sum=30

      It sounds like it should be easy enough but I've been playing with it for weeks and can't get what I need. Any help would be appreciated.

      Thanks,
      TheOneRing
     Post a reply

    Message from Christoph Bergmann on 1/3 2004, 18:12 +01:00
    EMail: info@baseportal.com

    Re: Really need help here - perl


      Try this:

      <loop code=perl>
      $sums{$Title}+=$Size
      </loop>
      <perl>
      foreach $title (%sums)
      {
      out "$title sum =$sums{$title}<br>";

      }
      </perl>

      ;-))

     Post a reply

 Messages from 2850 to 3000: To the input form 
<< Newest messages | < Newer messages | To the input form | Older messages > | Oldest messages >>


Back to the homepage

© baseportal.com. All rights reserved. Terms of use



baseportal.com