Data read line by line add 4 arrays to db

Discussion in 'PHP' started by iNod, Dec 10, 2006.

  1. #1
    Hello There,

    I want to read the file data34.db into an array using file_get_contents.
    Than I will explode the contents into arrays using the | as the separator.

    But now I am stuck. What I am trying to do is.

    Take something like

    ip|12125|17-01-31|2006-12-10
    ip|6376|17-01-36|2006-12-10
    ip|5258|17-01-37|2006-12-10
    ip|12306|17-01-37|2006-12-10
    ip|12837|17-01-40|2006-12-10
    ip|3817|17-01-44|2006-12-10

    And add it to the database.

    Database
    ip, id, time, date

    I am stuck trying to figure out how I would take those rows and add each to the database and than delete the line from the file. (I found a function to do that so nvm that part)

    Any advice?

    - Steve
     
    iNod, Dec 10, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375