Databases Reference
In-Depth Information
Calendar pop up
As an added benefit, phpMyAdmin offers a calendar pop up for easy data entry.
We will start by adding a
DATE
column type—
date_published
—to our
topic
table.
If we go into
Insert
mode, we should now see the new column where we could
type a date. A
Calendar
icon is also available. This icon brings a pop-up window,
synchronized to this
DATE
column type. If there is already a value in the column,
the pop up is displayed accordingly. In our case, there is no value in the column, so
the calendar shows the current date as shown in the following screenshot:
Small arrows permit easy scrolling through months and years. A simple click on
the date we want transports it to our
date_published
column. For a
DATETIME
or
TIMESTAMP
column type, the pop up offers the ability to edit the time part.
If we type a date or time value, a validation is done if our browser
is JavaScript-enabled; incorrect values are highlighted in red.
TIMESTAMP option
Starting with MySQL 4.1.2, there are more options that can affect a
TIMESTAMP
column type. Let us add to our
book
table, a column named
stamp
of type
TIMESTAMP
. In the
Default
drop-down, we could choose
CURRENT_
TIMESTAMP
; but we won't for this exercise. However, in the
Attributes
column,
we choose
on
update
CURRENT_TIMESTAMP
. More details are available at
http://dev.mysql.com/doc/refman/5.5/en/timestamp.html
.
Search WWH ::
Custom Search