MySQL query or condition to fetch "1970-01-01" date value in the table cell |
MySQL query or condition to fetch "1970-01-01" date value in the table cell |
shankar from vizag |
Dec 9 2023, 08:33 PM
Post
#1
|
Advanced Member Group: Members Posts: 202 Joined: 18-June 13 Member No.: 19,316 |
Greetings
I have a mysql table with date column cell. At the time input from the php page, if a date type input left blank which is saving 1970-01-01 as the cell value. When I use select query to display records, those particular fields displaying 1970-01-01. Could anyone help me either in saving the empty date field as 1970-01-01 as blank or a condition to display a blank field in the php page by the select query when the cell value contains 1970-01-01. Regards shankar |
CharlesEF |
Dec 10 2023, 03:29 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,984 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Or, you could set the column as 'Default NULL'. Then only post the date after you check to be sure it's not blank.
|
shankar from vizag |
Dec 12 2023, 01:45 AM
Post
#3
|
Advanced Member Group: Members Posts: 202 Joined: 18-June 13 Member No.: 19,316 |
Or, you could set the column as 'Default NULL'. Then only post the date after you check to be sure it's not blank. thank you for replies. I tried both ways. But when I left a Date type input field empty, it is saving 1970-01-01. What I am doing now is, while fetching records with select query, masking if the date is 1970-01-01 with rgba(0,0,0,0). If the table dont save like that, problem will be solved. Kindly help me out. Regards |
CharlesEF |
Dec 12 2023, 02:08 AM
Post
#4
|
Programming Fanatic Group: Members Posts: 1,984 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Or, you could set the column as 'Default NULL'. Then only post the date after you check to be sure it's not blank. What I am doing now is, while fetching records with select query, masking if the date is 1970-01-01 with rgba(0,0,0,0). This post has been edited by CharlesEF: Dec 12 2023, 02:09 AM |
Lo-Fi Version | Time is now: 25th September 2024 - 03:03 PM |