Re: Inserting time + date entry into mySQL DB
| From: | elias | Date: | Wed, 11 Apr 2001 00:08:57 +0000 |
| Subject: | Re: Inserting time + date entry into mySQL DB | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48029@lists.php.net to get a copy of this message | ||
I believe there is some misunderstandings...
I believe Zeus just doesn't know how to insert current date in his database:
ie: INSERT INTO MyTable(other_field, date_field) VALUES('adasd', NOW())
this will insert in your date field the current datetime.
-elias
http://www.kameelah.org/eassoft
"Michael Hall" <lists@mulga.com.au> wrote in message
news:Pine.LNX.4.10.10104102120380.15611-100000@localhost.localdomain...
>
> This is all explained in the PHP manual under dates.
> Assuming you have a field called 'date' with a timestamp in it,
> you can format the date like this:
>
> $date = date("l jS F Y", $date);
>
> But there are a lot of options so read the manual.
>
> Mick
>
> > I want it such that when a user reads the news, he sees something like
> >
> > ---------------
> > Saturday 25th March 2001
> > New mirror up on PHP - posted by Zeus @ 00:00 GMT +8
> >
> > news news news news news news news news news news news news news
> > ---------------
> >
> > That sort of thing, how can I go about?
> >
> >
> >
> >
> > ----- Original Message -----
> > From: elias <elias_bachaalany@yahoo.com>
> > To: <php-general@lists.php.net>
> > Sent: Wednesday, 11 April, 2001 7:23 AM
> > Subject: Re: [PHP] Inserting time + date entry into mySQL DB
> >
> >
> > > No under windows doesn't work.
> > > you have to enter a value in that field with value NOW()
> > >
> > > -elias
> > > http://www.kameelah.org/eassoft
> > >
> > > "Michael Hall" <lists@mulga.com.au> wrote in message
> > >
news:Pine.LNX.4.10.10104102051270.15611-100000@localhost.localdomain...
> > > >
> > > >
> > > > Create a field in your table called something like 'date' and make
its
> > > > data type TIMESTAMP. MySQL will automatically add a timestamp with
each
> > > > new entry ... assuming you're using UNIX, I don't know about
windows.
> > > >
> > > > Mick
> > > >
> > > > > I know this has been brought up repeatedly but I couldn't find the
> > > archives website.
> > > > > I'm doing a news publishing script (something like newsphp \
php-nuke)
> > > but uses mySQL to store all the data instead of flat files.
> > > > > I would like to make it such that everytime I submit an news
entry,
> > the
> > > time\date will automatically be inserted in that row.
> > > > > Could someone give me some suggestions?
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > > For additional commands, e-mail: php-general-help@lists.php.net
> > > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>