Reply to Re: using php to move rows from text file into mysql table

Your name:

Reply:


Posted by mantrid on 06/21/07 15:43

"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:op.tt9gsfppqnv3q9@metallium...
> On Thu, 21 Jun 2007 02:17:08 +0200, mantrid <ian.dandav@virgin.net> wrote:
>
> > That did it. thanks.
> > Just one problem with the field datetime (type datetime). values are not
> > saving, get 0000-00-00 00:00:00 added instead of the actual date and
> > time.
>
> That is what happens if MySQL gets a string it cannot interpret as a
> datetime field. Check the format of the date you have in the file, and
> adjust it before inserting to MySQL's format.
>
> --
> Rik Wasmus

Is it best to do that in Excel or use a php date format function?
In Excel it is dd/mm/yyy
but it wont allow me to save as a CVS file in the form yyy-mm-dd hh:mm:ss,
it just changes it back.
ive tried DATE_FORMAT('".$dateandtime."','%Y-%m-%d %H:%i:%s') in the sql
statement but its not working, am I using this function wrongly?

Do you know a php function that does a similar thing? I know the date format
characters (eg d M Y etc) but can only see examples of their use with
date(), which is the current date, not a date from my CVS file.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация