Take this simple little script with 3 fields:
id
name
birthday
How can I get it so a user can simply enter their birthday into a text field, And have have MySQL accept it? When I try the following it shows success, but the record is not saved. If I remove the birthday field, everything works normally, of course. Here's the relevant (partial) code
<CFINPUT TYPE="text" NAME="birthday" VALUE=""> and then when the form is submitted through:
<cfquery name="saveme" datasource="dbase" dbtype="ODBC" username="username" password="password" dbserver="localhost" dbname="database">
INSERT into foo values (#id#,#name#,#birthday#</cfquery>
I don't use Validation because it required downloading the CAB file, and lots of MSIE users have ActiveX turned off. Plus, when I did try it, with both date and eurodate validation, it still didn't work.
CFINSERT does the same thing.
I've tried hundreds of combinations of DATEFORMATs and such and they all give errors. I know I could have 3 more fields, one for month, day and year, but for my purposes this is the most efficient way. In other tables, pulling the data out,or setting a NOW() date is no problem, just this user input scenario.
Any masters out there care to part with a bit of wisdom?
Many thanks in advance
Kelani
id
name
birthday
How can I get it so a user can simply enter their birthday into a text field, And have have MySQL accept it? When I try the following it shows success, but the record is not saved. If I remove the birthday field, everything works normally, of course. Here's the relevant (partial) code
<CFINPUT TYPE="text" NAME="birthday" VALUE=""> and then when the form is submitted through:
<cfquery name="saveme" datasource="dbase" dbtype="ODBC" username="username" password="password" dbserver="localhost" dbname="database">
INSERT into foo values (#id#,#name#,#birthday#</cfquery>
I don't use Validation because it required downloading the CAB file, and lots of MSIE users have ActiveX turned off. Plus, when I did try it, with both date and eurodate validation, it still didn't work.
CFINSERT does the same thing.
I've tried hundreds of combinations of DATEFORMATs and such and they all give errors. I know I could have 3 more fields, one for month, day and year, but for my purposes this is the most efficient way. In other tables, pulling the data out,or setting a NOW() date is no problem, just this user input scenario.
Any masters out there care to part with a bit of wisdom?
Many thanks in advance
Kelani