CSV file-based address book code snippet?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fred

    CSV file-based address book code snippet?

    Hi,

    Since I'm a PHP newbie and the only address book apps I found
    through Google require MySQL or PostgreSQL, I figured I'd ask if
    someone has come code handy.

    I'd just like to keep a list of addresses in a CSV file (ie. columns
    last name, first name, e-mail, office #, etc.) so as to ease backing
    up, and read/update this list from a PHP script.

    I guess it's pretty much just a loop to read + parse, and a form to
    update, but if someone has the code handy, I'm interested :-)

    Thanks for any tip
    Fred.
  • Geoff Berrow

    #2
    Re: CSV file-based address book code snippet?

    I noticed that Message-ID: <qa0fg0lkil9g0m evn55ge36cjbhfn 5ng9s@4ax.com>
    from Fred contained the following:
    [color=blue]
    > Since I'm a PHP newbie and the only address book apps I found
    >through Google require MySQL or PostgreSQL, I figured I'd ask if
    >someone has come code handy.
    >
    >I'd just like to keep a list of addresses in a CSV file (ie. columns
    >last name, first name, e-mail, office #, etc.) so as to ease backing
    >up, and read/update this list from a PHP script.[/color]

    This is what databases are good at, that's why people use them. Do you
    not have one available?
    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Fred

      #3
      Re: CSV file-based address book code snippet?

      On Wed, 28 Jul 2004 18:25:21 +0100, Geoff Berrow
      <blthecat@ckdog .co.uk> wrote:[color=blue]
      >This is what databases are good at, that's why people use them. Do you
      >not have one available?[/color]

      Thx, but I'd rather use a flat file instead for easier update and
      backup. Since I didn't find some basic coden I ended up writing the
      thing in VB and a grid object.

      Cheers
      Fred.

      Comment

      • Geoff Berrow

        #4
        Re: CSV file-based address book code snippet?

        I noticed that Message-ID: <kauhg0dbpkq353 v48040e5dgcglka ibgq1@4ax.com>
        from Fred contained the following:
        [color=blue][color=green]
        >>This is what databases are good at, that's why people use them. Do you
        >>not have one available?[/color]
        >
        >Thx, but I'd rather use a flat file instead for easier update and
        >backup. Since I didn't find some basic coden I ended up writing the
        >thing in VB and a grid object.[/color]

        Oh, I'm sure that was /much/ easier...

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        • Fred

          #5
          Re: CSV file-based address book code snippet?

          On Thu, 29 Jul 2004 16:23:25 +0100, Geoff Berrow
          <blthecat@ckdog .co.uk> wrote:[color=blue]
          >Oh, I'm sure that was /much/ easier...[/color]

          Don't know, since I didn't find anything in PHP that didn't include
          the kitchen sink :-)

          Fred.

          Comment

          • Geoff Berrow

            #6
            Re: CSV file-based address book code snippet?

            I noticed that Message-ID: <52eig0pdp928oi a43cracc17fbd6c mkofr@4ax.com>
            from Fred contained the following:
            [color=blue][color=green]
            >>Oh, I'm sure that was /much/ easier...[/color]
            >
            >Don't know, since I didn't find anything in PHP that didn't include
            >the kitchen sink :-)[/color]

            That /is/ a problem. It's a toss up whether it's better to struggle
            with a pre-written script or roll your own. For the moment I'm rolling
            my own. I'm making lots of mistakes but I'm learning all the time.

            That said, a simple guest book shouldn't be a problem to you.

            --
            Geoff Berrow (put thecat out to email)
            It's only Usenet, no one dies.
            My opinions, not the committee's, mine.
            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

            Comment

            • Michael Austin

              #7
              Re: CSV file-based address book code snippet?

              Geoff Berrow wrote:
              [color=blue]
              > I noticed that Message-ID: <52eig0pdp928oi a43cracc17fbd6c mkofr@4ax.com>
              > from Fred contained the following:
              >
              >[color=green][color=darkred]
              >>>Oh, I'm sure that was /much/ easier...[/color]
              >>
              >>Don't know, since I didn't find anything in PHP that didn't include
              >>the kitchen sink :-)[/color]
              >
              >
              > That /is/ a problem. It's a toss up whether it's better to struggle
              > with a pre-written script or roll your own. For the moment I'm rolling
              > my own. I'm making lots of mistakes but I'm learning all the time.
              >
              > That said, a simple guest book shouldn't be a problem to you.
              >[/color]

              the problem with a flat file approach is that is bascially single-user, but if
              you are the only user then you are good to go...

              --
              Michael Austin.
              Consultant - Available.
              Donations welcomed. Http://www.firstdbasource.com/donations.html
              :)

              Comment

              • Fred

                #8
                Re: CSV file-based address book code snippet?

                On Thu, 29 Jul 2004 19:04:05 GMT, Michael Austin
                <maustin@firstd basource.com> wrote:[color=blue]
                >the problem with a flat file approach is that is bascially single-user, but if
                >you are the only user then you are good to go...[/color]

                Right. This is just to be used on a LAN with a few hosts. I'll learn
                how to do this in PHP some other time then :-)

                Thx
                Fred.

                Comment

                • Alex Hunsley

                  #9
                  Re: CSV file-based address book code snippet?

                  Fred wrote:[color=blue]
                  > On Thu, 29 Jul 2004 19:04:05 GMT, Michael Austin
                  > <maustin@firstd basource.com> wrote:
                  >[color=green]
                  >>the problem with a flat file approach is that is bascially single-user, but if
                  >>you are the only user then you are good to go...[/color]
                  >
                  >
                  > Right. This is just to be used on a LAN with a few hosts. I'll learn
                  > how to do this in PHP some other time then :-)
                  >
                  > Thx
                  > Fred.[/color]

                  aha, so it's not actually single user. Couldn't a few users access it at the
                  same time and cauuse problems (anomalies)?

                  Comment

                  • Fred

                    #10
                    Re: CSV file-based address book code snippet?

                    On Fri, 30 Jul 2004 10:58:44 +0100, Alex Hunsley
                    <lard@tardis.ed .ac.molar.uk> wrote:[color=blue]
                    >aha, so it's not actually single user. Couldn't a few users access it at the
                    >same time and cauuse problems (anomalies)?[/color]

                    It's OK, it's just the three of us. Ideally, I'd like an UPDATE button
                    that would direct the user to a form to add/modifiy/delete a record. I
                    prefer to keep this in a flatfile because I know I can easily see the
                    contents and modify it with a text editor if need be.

                    Anyway, it's up and running as an ActiveX control, but if someone has
                    some code snippet to do this, I'm interested :-)

                    Thx
                    Fred.

                    Comment

                    Working...