Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: spreadsheet

  1. #1
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post

    spreadsheet

    Has anyone come across a PHP spreadsheet? I've been searching for a while but haven't been able to find one.

    Basically I have a fixed number of columns 31, and I need a variable number of rows. The data has to be either written to a file, maybe xml or comma delimited text file or a mysql database.

    I could write it myself but if there is an existing system out there I'd like to base my code on that if possible, save me the time and effort.
    Omnis mico antequam dominus Spookster!

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i've done things like that.

    there a a few tricks to do this efficiently:
    - the formfielddata (your rows and columns of the datasheet) should be one multidimensional array like

    <input type="text" name="datasheet[xxx][yyy]" ... />

    where xxx is the Primary Key of the record, and yyy is the columnname.
    Note --> no quotes around the arreykeys !

    - you also need to store the same array in a sessionvariable
    - after posting, you compaire each element from

    $_POST['datasheet'] to the corresponding record from $_SESSION['datasheet']
    This way you only need to update the records where one of the values was actually changed

    - if the page is accesible to people that don't need to know your tablestructure, then you need to keep an extra session-array with the columnnames and their order in the table + use that order as yyy
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Good ideas.
    I was thinking about just numbering each sequentially and then splitting them into rows and cols on the serverside.. But that way is more efficient by far.

    Seeing as you have some experience I probably be back if I get stuck. But I think I can handle it. Thanks.
    Omnis mico antequam dominus Spookster!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •