General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old February 11th, 2003, 05:19 AM
maryer maryer is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 13 maryer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
data transfer - pls help

Dear all,
In mysql database there is table downup
************************
site enum('site1', 'site2'),
down datetime,
up datetime
************************
and there is file with such statistics about site1, site2 down and up period
************************
2003-01-28 15:42:08 (back up)
2003-01-27 14:05:45 (down)
2003-01-25 15:54:17
2003-01-25 15:11:19
2003-01-23 09:38:19
2003-01-23 09:06:55
2003-01-10 13:42:38
2003-01-10 12:45:40
2003-01-07 01:56:44
2003-01-07 01:34:47
************************
how to transfer these datas to the mysql table. it is need check if there is not back up the data will not be transffered and always check the highest datetime / event has to be writen on the top/last.
should i use regular expression (preg_match)
I would be very thankful if you help me as soon as possible.
Best regards
Maryer

Reply With Quote
  #2  
Old February 11th, 2003, 07:05 AM
ramz ramz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Juiz de Fora - MG- Brazil
Posts: 93 ramz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to ramz Send a message via MSN to ramz
You can use the mysql command LOAD DATA INFILE, below is an example

$sql = "LOAD DATA INFILE '/my/dir/file.txt' INTO TABLE downup LINES TERMINATED BY '\n' (site, down, up)";

This might help you.
You can read more about this command at MySQL website, here is the link:

http://www.mysql.com/doc/en/LOAD_DATA.html
__________________
Regards,
Ramiro Varandas Jr.

Reply With Quote
  #3  
Old February 12th, 2003, 05:37 AM
maryer maryer is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 13 maryer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thank you very much for reply, but this doesn't help much because it gave NULL in mysql table. though .txt file is not empty

Reply With Quote
  #4  
Old February 13th, 2003, 01:44 AM
maryer maryer is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 13 maryer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
maybe i have to use file() functions to get information from html file and then regular expression to get right data and insert it to the mysql table?

thank you

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > data transfer - pls help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway