CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Mysql date problems

Print topic Send  topic

Author Message
Shawn Scott
Posted: 08/07/2002, 1:26 PM

I have a Mysql database that has a DATETIME field I am trying to update with
the current date and time when the data is inserted. I have set the default
value to be Now() on this field. When I run a manual insert into the Mysql
database this works fine. I have written a short Perl script to insert data
into the database, this works fine. When I use Code Charge Generated Code it
sets the field to all zeros. It seems that CCS is sending an invalid date to
the mysql server. I am not sure why this would be happening since there is
no code that references this field in my code. It simply inserts several
items of user input and the rest of the fields are set using the defaults of
the table, the DATETIME is one that uses the defaults.
Can anyone give me any ideas why this would be happening.

I use MySql, Apache and Perl

Thanks
-SDS




Frank Rocco
Posted: 08/08/2002, 8:23 AM

In CCS, you have to define the date/time format used.
on any field, you can set the DBFormat to yyyy-mm-dd hh:mm:ss and mySQL will
be happy.
You can also define this global in the project settings under connection.

HTH

Frank

Shawn Scott
Posted: 08/08/2002, 1:16 PM


"Frank Rocco" <farocco@hotmail.com> wrote in message
news:aiu2cm$6fj$1@news.codecharge.com...
> In CCS, you have to define the date/time format used.
> on any field, you can set the DBFormat to yyyy-mm-dd hh:mm:ss and mySQL
will
> be happy.
> You can also define this global in the project settings under connection.

I am pretty sure I have all these set correctly, The thing is Code Charge is
not submitting a date , Here is a little clearer description of the problem.

My Database fields look like this

name
address
phone
username
password
date_entered -> default set to Now()

The data that ius submitted form the form is
name
address
phone
username
password

So by defaul the date_entered filed in the database should be populated
withe the current date and time. For some reason code charge is breaking
this field and I can't figure out why.



DonB
Posted: 08/08/2002, 4:36 PM

Check the code, where the "UPDATE" statement is built. Do you see the date
field listed there?

I have seen controls become "unhooked", and the simplest thing was to just
delete and re-add the control. Had one yesterday - a checkbox that would
just not "check" itself. Everything looked ok, but it just refused to obey.
Putting a fresh one on the page cured it.

don

"Shawn Scott" <shawn@edgeofsanity.com> wrote in message
news:aiujip$5bb$1@news.codecharge.com...
>
> "Frank Rocco" <farocco@hotmail.com> wrote in message
>news:aiu2cm$6fj$1@news.codecharge.com...
> > In CCS, you have to define the date/time format used.
> > on any field, you can set the DBFormat to yyyy-mm-dd hh:mm:ss and mySQL
> will
> > be happy.
> > You can also define this global in the project settings under
connection.
>
> I am pretty sure I have all these set correctly, The thing is Code Charge
is
> not submitting a date , Here is a little clearer description of the
problem.
>
> My Database fields look like this
>
> name
> address
> phone
> username
> password
> date_entered -> default set to Now()
>
> The data that ius submitted form the form is
> name
> address
> phone
> username
> password
>
> So by defaul the date_entered filed in the database should be populated
> withe the current date and time. For some reason code charge is breaking
> this field and I can't figure out why.
>
>
>
>

news.bellatlantic.net
Posted: 08/14/2002, 6:58 PM

I have 2 fields in my MySql database that have dates, one is a time stamp, I
have it set with the type TIMESTAMP and default value of Now() so very time
the row is updated the timestamp resets to the current date and time. I also
have a date_entered field, this is set as type DATETIME also set with a
default as Now(), this is set when a row is created. In a grid I have both
these in labels. When the grid is displayed it will not show the timestamp
field. As soon as I change the field type in my database to timedate and
refresh the page the dates show up.

Date problem number 2 is I have a record set to input some values. When I
submit the record to the database the field set for timestamp is set
correctly to the current date and time. However the DATETIME field has all
zeros. After reading on the MySql docs I found this

"Illegal DATETIME, DATE, or TIMESTAMP values are converted to the ``zero''
value of the appropriate type ('0000-00-00 00:00:00', '0000-00-00', or
00000000000000). "

This would tell me that Code Charge Studio is inserting something into the
filed the MySql server doesn't like. I don't understand why however because
they are not even on my record form. I am strictly letting the database set
and update these fields.

I have looked through the code and don't see any references to these fields.

I am pulling my hair out on this one...anyone else see a problem like this?

Any suggestions are greatly welcome.

-Shawn




   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.