SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Non-Member
    Join Date
    Nov 2003
    Location
    here
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help needed with project: only 2 days to complete! :(

    Hi guys, I'm working on a mini-php project and I've only got a couple of days to churn something out. I'm half way between beginner and intermediate so i have a good grounding in php, but would like some expert help in how I might go about this task.

    This is an outline of the features the code needs to contain:

    - Download a csv file of jobs from a pre-defined URL
    - Copy all contents of csv file into main table
    - Each row of the csv file, add an extra column with a timestamp of when it was added.
    - Provide web front end allowing user to download csv and upload to database.
    - Check whether csv file has been updated - this is where I am stuck for ideas, could you check some variable on the file like date modified, store it in a table and check it to see if its changed?
    - Automatically remove data older than a certain number of days (cron job? im new to this concept )
    - Allow user from the web front end to search for data between a certain date range.

    The actual coding shouldn't take too long as I'm confident most of these techniques will have been done before elsewhere so its just a matter of adapting code, the web front end does not have to be overcomplicated and all it has to do is display the basic data and allow the user to order it and search for date ranges etc, as well as updating the database by downloading the new csv ofcourse. Downloading is something I've not done in php either so help here would be nice.

    Anyway, anyone that could provide some ideas, suggest some functions I could use to accomplish these features, I'd be extremely grateful!

    Thanks a lot for your time.
    Regards,
    Cristiano.

  2. #2
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since you have a rough idea of what is required, have you looked at www.hotscripts.com since you think it's going to be relatively easy to adapt pre written script ?

    Which in it's self can lead to far more trouble than just sitting down and writing the scripts yourself from scratch

    You might also want to look at www.phpclasses.com for your download scripts

    If you've got 2 days to get something together, I think you'll need more time by the looks of it, as I know I couldn't do all that in 2 days from a clean slate, and I'm not new to PHP either

  3. #3
    SitePoint Member
    Join Date
    Aug 2004
    Location
    in a house
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this will get you started.

    The script works great, except that only the first line of data in the file is being loaded into the table. I have to assume this is a problem with the formatting in the text file, but I just don't know.

    The php script is too long to paste here, but can be found here:
    http://kinsuth-mar.com/scripts/import.txt

  4. #4
    Non-Member
    Join Date
    Nov 2003
    Location
    here
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe, thanks for your help guys.

    Anymore ideas will be welcomed. I'll get cracking with this and if its ok come back when I get stuck.

    I don't need to get the downloading done first, that can come later. First I'll just use some example data in the database and build the viewing/sorting. Then tomorrow night work on the downloading and uploading of the csv.

  5. #5
    Non-Member
    Join Date
    Nov 2003
    Location
    here
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    P.S - I think I came across wrong. I do not intend to use pre-made scripts or steal code, I am writing it from scratch myself What I meant was I expected similar things have been done which I can use for reference and a guide in writing my own code.

    Thanks for your advice Widow, its appreciated


Bookmarks

Posting Permissions

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