#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Brisbane,Q,Au
    Posts
    16
    Rep Power
    0
    Hi everyone,

    What i need to do is get the results from a flatfile.

    While only displaying 10 results at a time. And a next button or maybe search feature to view the rest.

    heres how the flatfile is done
    $field1|$field2|$fields3|$field4

    I need to be ale to print how may records are in the file.

    And to return 10 results at a time.

    Any ideas,
    Wazza
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    81
    Rep Power
    15
    Best bet, if the file isn't too huge, is to just dump the entire file into a big ol' array (if the file is <10k in size, this approach will be fine -- bigger than that you might want to look at how the file is used to see where optimisations could be made). Use the following to get your records into a list:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    my @records = ();
    open FH, 'filename';
    while( <FH> )
    {
    push @records, split /|/;
    }
    [/code]

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Brisbane,Q,Au
    Posts
    16
    Rep Power
    0
    What i actually need to do is have a number display at the top of the page telling me how many records are in the particular file.

    And returning 10 results at a time. With a next 10 results link.

    This is the last thing i need to work out for this particular script. Hopefully i can find the answer here.

    Thanks for the reply,

    Wazza
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Hopefully i can find the answer here

    I am sure alot of people here know how to do it including me. I am not trying to be selfish but I don't want to post my codes here with nothing in return.

    The best I can offer is to give you a link to download particular script that can do what you requested, then you are on your own to figure it out. If you don't understand some of the codes after spending your time and of course, with effort, then feel free to post it here.

    Here is the link -> http://www.dcscripts.com/
    and get 'dcguest' script.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Brisbane,Q,Au
    Posts
    16
    Rep Power
    0
    Thanks mate,

    Thats exactly what im after. Never even thought about looking at a guest book script

    Thanks again,
    wazza
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Brisbane,Q,Au
    Posts
    16
    Rep Power
    0
    removed

    [This message has been edited by wazza (edited September 06, 2000).]
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Brisbane,Q,Au
    Posts
    16
    Rep Power
    0
    .
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Brisbane,Q,Au
    Posts
    16
    Rep Power
    0
    never mind ill figure it out
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Tampa, FL, US
    Posts
    7
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by freebsd:
    >>I am not trying to be selfish but I don't want to post my codes here with nothing in return.
    [/quote]

    What you get in return is that someday, someone might share code with YOU when you get stuck...
  18. #10
  19. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    There is no free lunch in the world. Especially in a public forum like this. If he is struggling, he can always hire someone to do it for him. If you are really that kind, why don't you post your codes and help him out then? Futher, I already posted a link to solve his exact problem if he still can't figure it out, he is on his own as I mentioned.

    >>someone might share code with YOU when you get stuck...

    Yeah. What if I get stuck, I would do some searching on the net to find an answer and solve it on my own. But so far that hasn't happened to me that often.
  20. #11
  21. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    19
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by turbobri:
    What you get in return is that someday, someone might share code with YOU when you get stuck...[/quote]

    Are you about the not documentary possibilities and the closed program codes of Microsoft? (Joke)

  22. #12
  23. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Brisbane,Q,Au
    Posts
    16
    Rep Power
    0
    Come on guys dont` stress.

    I ended up getting it all working. So its all Good

    Cheers.
    Wazza
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Chennai,TamilNadu,India
    Posts
    33
    Rep Power
    15
    Wazza, did you find any answer for your flat file question, coz i didnt find any answer there in the forum, only arguments between the members.

    Raghu.
  26. #14
  27. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>coz i didnt find any answer there in the forum

    As I said, read the link I posted in this thread. Read my 1st reply above.

IMN logo majestic logo threadwatch logo seochat tools logo