SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Ottawa, Canada
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    populating mySQL dynamically

    Hello,
    I have php up a running with Apache web server on a UNIXware machine, I am pulling data out from a Informix DB to a deliminated text file, and this is being done every two minutes using a unix cron job.

    What I want to do is... load the data from the deliminated text file to my mySQL DB, I would like this done every two minutes, for this data will be displayed on my web page using PHP, and needs to be up-to-date. (atleast 2 minutes up-to-date).

    Any advice on where to start as far as populating mySQL from the text file every two minutes?
    Last edited by Brennen; Mar 28, 2001 at 09:55.
    thanks,
    brennen

  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What scripting language are you using on your website? If you are using PHP then it has inbuilt functions (It does if they are compiled in) for accessing Informix databases.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  3. #3
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Ottawa, Canada
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, php,

    I have the data pulled from informix (it's being stored in delimited text files) and now I need populate my mySQL tables with the data in this files.

    I want to be able to re-populate the mySQL tables every two minutes (probably through a UNIX cron job), but I need to know how to go about getting the data (from the text files) to my mySQL tables before i worry about the cron job.

    I looked at a few different mySQL tools such as:

    -Using mySQL in BATCH mode

    -using mysqlimport

    but the examples I find in the manual are not really clear to me weather they would work in my case or not.

    Do you still have help for me?
    thanks,
    brennen

  4. #4
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for loading the data from the file check out LOAD DATA

    http://www.mysql.com/doc/L/O/LOAD_DATA.html


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
  •