Re: Date Function - Empty Value
| From: | Gabe | Date: | Thu, 20 May 2004 19:14:56 +0000 |
| Subject: | Re: Date Function - Empty Value | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186621@lists.php.net to get a copy of this message | ||
Torsten Roehr wrote:
"Gabe" <ydnahg-news4432@mailblocks.com> wrote in message news:20040520162742.33097.qmail@pb1.pair.com...After looking carefully through the table structure, it does allow NULL values. So maybe I'm not passing it correctly to the variables in the SQL. I thought I was....Torsten Roehr wrote:DB"Gabe" <ydnahg-news4432@mailblocks.com> wrote in message news:20040519211125.84931.qmail@pb1.pair.com...Torsten Roehr wrote:or"Gabe" <ydnahg-news4432@mailblocks.com> wrote in message news:20040519193101.75891.qmail@pb1.pair.com...Torsten Roehr wrote:"Gabe" <ydnahg-news4432@mailblocks.com> wrote in message news:20040519152017.13913.qmail@pb1.pair.com...Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/yyyy ). For some reason it won't let me post an empty value to that field in the DB. I've tried using empty quotes ( "" )ThatNULL and I always get a datatype mismatch sql error. So then I just tried submitting a date that will never be used ( e.g. 1/1/1111 ).works, but then when I try to read the date out of the field in the19-01-2038theand format it using the date() function in PHP it doesn't display anything (which is fine with me). I read up on the date function onPHP website and valid dates are limited from 01-01-1970 tonothing.onwindows machines. So that explains why the function returnsofSo, I guess my question is this: Is what I'm doing technically ok (using a date that's not in the valid range)? Or does anyone knowShouldantheempty date value that I can submit to the DB? Thanks!NULL should work if you have allowed it for the column when creatingIn the mysql command line, if possible or if you're using phpMyAdmin.Sorry Torsten, but you'll have to forgive my lack of understanding. Where should I put that command in? Thanks for you patience.This command should show you the table structure: SHOW CREATE TABLE tablename Please post the output. regards, Torstentable. Can you post your table structure? Regards, TorstenWell, I would, but I can't seem to figure out how to export just the structure out of access. Wouldn't NULL be allowed by default?Doalso work with mysql_query() in a php script and echoing out the result.I'm not familiar with Access but should have an option or specific view to show you the table structure. Look at the Access program help for something like that. Regards, Torstenyou know how to do this? Regards, TorstenI'm using Microsoft Access for my database not MySQL. Does that change what I need to do?