Hi Nelson,

On Jun 8, 8:16 am, Nelson <[EMAIL PROTECTED]> wrote:
> I know that would be easier if I ask user to save the file in CVS
> format, but problem is the date file on column B.  The MySQL was uses

It makes life oh so much better if you can use a CSV file: there's not
faffing around with different versions of Excel.

One solution would be to use a VBA macro in Excel such as the one
mentioned in http://www.dicks-blog.com/archives/2004/11/09/roll-your-own-csv/

A lot depends upon what 'control' you have of your users --- and
whether you can dictate to the that they must use a macro to do the
export.

A second solution would be to ask the user to specify date format when
they upload a csv: three radio buttons for dd-mm-yyyy, mm-dd-yyyy and
yyyy-mm-dd should cover it, and then preprocess the date field
appropriately before inserting into the sql.

Note that you should always sanity check the csv before import anyway:
you don't want anyone injecting a lump of code straight into your
database.... and you need to be watchful for malformatted files too.

Hope that helps,

Kind regards,
    Geoff


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to