Jump to content

[SOLVED] Inputing a date into MSQL from a post form


NewbieBryan

Recommended Posts

I have created a form that captures a couple of fields: Name; Description; Date

 

The Database structure allows VARCHAR for the Name; DEscrip; etc and I have set the Date in the table to DATE

 

The problem is that when I capture data from the form; all the VARCHAR fields are correctly completed but the Date field remains empty.

 

I have tried a couple of sequences (20090708 and 2009-07-08 and 2009/07/08)

 

I suspect this may have to do with the input type on the form itself :

 

DateAdded :<input type="text" name="DateAdded" /> <P>

DateDue :<input type="text" name="DateDue" /> <P>

 

Is there a "date" type?

 

Am I on the right track here with my logic?

 

 

ADDED LATER: (Aplogies - Just read the requirements)

Server version: 5.0.32-Debian_7etch10-log

 

Query
$result = mysql_query("SELECT * FROM todo");

 

Link to comment
Share on other sites

Hi PFMaBiSmAd,

 

Apologies if this is the incorrect section (still finding my feet around here) - If so, please point me in the right direction.

 

Following on the initial post:

 

Long and short is that I am posing data from a PHPform into a MySQL Db (ver5.x)

 

My table fields are formated as either VARCHAR or DATE

 

The problem is that when posting from the form it appears as if only the VARCHAR fields are populated (although there are values submitted for the DATE fields as well) when doing a query on the Db

 

There are no errors displayed on posting whatsoever so I am at a loss.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.