MySQL Forums
Forum List  »  Newbie

Still Having Problems with DATE....
Posted by: Raymond Jender
Date: June 20, 2021 03:05PM

So I have a $currentdate = 2021-06-20
When I insert it into the database, it shows as 1995? Why?

mysql> select * from orderform;
+----+-----------+------+-------+-------------+
| id | jobnumber | year | month | currentdate |
+----+-----------+------+-------+-------------+
| 52 | 21060002 | 21 | 06 | NULL |
| 53 | 21060003 | 21 | 06 | NULL |
| 54 | 21060004 | 21 | 06 | NULL |
| 55 | 21060005 | 21 | 06 | NULL |
| 56 | 21060000 | 21 | 06 | NULL |
| 57 | 21060006 | 21 | 06 | NULL |
| 58 | 21060019 | 21 | 06 | 1995 |
| 59 | 21060020 | 21 | 06 | 1995 |
| 60 | 21060021 | 21 | 06 | 1995 |
| 61 | 21060022 | 21 | 06 | 1995 |
+----+-----------+------+-------+-------------+

The table desc is:
mysql> desc orderform;
+-------------+--------------------------+------+-----+----------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------------------+------+-----+----------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| jobnumber | int | NO | | 21060000 | |
| year | int | NO | | 21 | |
| month | int(2) unsigned zerofill | NO | | 06 | |
| currentdate | varchar(15) | YES | | NULL | |
+-------------+--------------------------+------+-----+----------+----------------+

I been dicking with this for a few days now. Are the NULL and Default items ok?

Options: ReplyQuote


Subject
Written By
Posted
Still Having Problems with DATE....
June 20, 2021 03:05PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.