/    Sign up×
Community /Pin to ProfileBookmark

Secure Data format (xls, csv, XML).

Hello,

I am dealing with data integration project. I am working with PHP and I need to receive data from either xls, csv, XML and need to load data in to mysql.

My questions:
1. Is it possible with mysql to insert that data in to mysql?
2. Can we schedule cron for mysql stored proc?
3. Which format is more secure?

Thanks in advance,
Mangesh.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SrWebDeveloperFeb 26.2010 — 
1. Is it possible with mysql to insert that data in to mysql?

2. Can we schedule cron for mysql stored proc?

3. Which format is more secure?
[/quote]


  • 1. As to XML using only MySQL just create a blob field, allow null. Then use the load_file() function:


  • [CODE]insert into table (myfile) values (load_file('/path_to/file.xml'));[/CODE]

    You could also use text, honestly, for any string up to 65535 chars which does not contain binary encoded data.

  • 2. I am pretty sure the only reason not would be if your webhost disables triggers and stored procedures for cron. Beyond a permissions issue, you could do something like this for your cron command (syntax below, up to you to use proper paths and your query, note no space after -p):


  • 0 0 *** mysql -h hostname -u username -ppassword -e "query"

  • 3. Huh? In what way? Name your concerns.
  • Copy linkTweet thisAlerts:
    @NogDogFeb 26.2010 — You can load a CSV file directly into MySQL via the [url=http://dev.mysql.com/doc/refman/5.1/en/load-data.html]LOAD DATA INFILE[/url] command.
    Copy linkTweet thisAlerts:
    @MindzaiFeb 27.2010 — Regarding the security, I suppose xls documents could be considered secure since you can password protect them, but relying on something microsoft created to be secure is never a good idea. The other two are plain text and easily read, but I suppose it depends on your definition of secure - what sort of security do you want?
    Copy linkTweet thisAlerts:
    @joshi_mangeshauthorFeb 27.2010 — Sorry, Instead of security I mean bugfree..all type of text it should support.

    thanks
    ×

    Success!

    Help @joshi_mangesh spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.4,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...