473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MySQL TimeStamp all ZEROES?

I have been trying to use a MySQL database with PHP having a date/time field set to timestamp(14).
It keeps being set to a string of all zeroes (00000000000000). This happens evn if I use a query
with a NULL value...

....the field is supposed to keep a record of modifications made to client records, so the TimeStamp
value seemed to be the best fit.

Is there sonmething I might be missing?

Thanks for any help offered,

Rick
Jul 17 '05 #1
3 2847
@$operamail$.com wrote:
...the field is supposed to keep a record of modifications made to client records, so the TimeStamp
value seemed to be the best fit.

Is there sonmething I might be missing?


Are you running in MAXDB mode?

Quote from the manual ( @ http://www.mysql.com/doc/en/DATETIME.html )

TIMESTAMP behavior when running in MAXDB mode

When MySQL is running in MAXDB mode, TIMESTAMP behaves like
DATETIME. No automatic updating of TIMESTAMP columns occurs,
as described in the following paragraphs. MySQL can be run
in MAXDB mode as of version 4.1.1. See section 5.2.1 mysqld
Command-line Options.

TIMESTAMP behavior when not running in MAXDB mode

[Description of the bahavior you want]
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Thanks for your reply...

I am using a server at my college...is there a way to tell if its in MAXDB mode from my Telnet
commandline?

If it is I imagine that I would need to use a DATETIME data type and set it with a query parameter
of 'time()'?

Rick

Pedro Graca wrote:
@$operamail$.com wrote:
...the field is supposed to keep a record of modifications made to client records, so the TimeStamp
value seemed to be the best fit.

Is there sonmething I might be missing?

Are you running in MAXDB mode?

Quote from the manual ( @ http://www.mysql.com/doc/en/DATETIME.html )

TIMESTAMP behavior when running in MAXDB mode

When MySQL is running in MAXDB mode, TIMESTAMP behaves like
DATETIME. No automatic updating of TIMESTAMP columns occurs,
as described in the following paragraphs. MySQL can be run
in MAXDB mode as of version 4.1.1. See section 5.2.1 mysqld
Command-line Options.

TIMESTAMP behavior when not running in MAXDB mode

[Description of the bahavior you want]

Jul 17 '05 #3
@$operamail$.com top-posted [corrected]:
Pedro Graca wrote:
@$operamail$.com wrote:
...the field is supposed to keep a record of modifications
made to client records, so the TimeStamp value seemed to
be the best fit.

Is there sonmething I might be missing?
Are you running in MAXDB mode?
I am using a server at my college...is there a way to tell
if its in MAXDB mode from my Telnet commandline?
perhaps
$ mysql --version
mysql Ver 12.22 Distrib 4.0.17, for pc-linux-gnu (i686)

No "MAXDB" anywhere on the version ... hopefully there's an indication
for MySQL's running in MAXDB mode :)

Or you might want to try the COSH() function -- this doesn't work
for me, it is only available in MAXDB mode.

$ mysql -p -e 'select cosh(0.33)'
Enter password:
ERROR 1064 at line 1: You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right
syntax to use near '(0.33)' at line 1
If it is I imagine that I would need to use a DATETIME data type
and set it with a query parameter of 'time()'?


I can't really tell. Check http://www.mysql.com/doc/en/MaxDB.html
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ben | last post by:
I would like to use php to query a database and retrieve a unix timestamp. The problem is that mysql is storing the data in the date format and not a timestamp. I am sure that I can amend my...
7
by: Joshua Beall | last post by:
Hi All, Any thoughts on the easiest way to translate a MySQL timestamp (which looks like 20040422090941) to the datetime format (which looks like 2004-04-22 09:09:41). This is just to make it...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
1
by: windandwaves | last post by:
Hi Folk Some of you may be interested in a function that allows you to add/substract from a date in PHP, using a MySql Dateformat (e.g. 2005-10-31) (NOT TESTED): Any comments appreciated. ...
1
by: gordon.dtr | last post by:
Hi, Has anyone had this problem ? I am using MySQL ODBC 3.51 Driver, with MS Access 2003 and MySQL 4.1.11 standard log. I created my tables in MS Access, then exported them via ODBC to an...
2
by: David | last post by:
Hi, Has anyone had this problem ? I am using MySQL ODBC 3.51 Driver, with MS Access 2003 and MySQL 4.1.11 standard log. I created my tables in MS Access, then exported them via ODBC to an...
2
by: Ted | last post by:
1) In several tables, in my MySQL version, I created columns using something like the following: `ab_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, This...
6
by: Brandon | last post by:
I'm using PHP with MySQL 4.x and was having trouble converting a datetime from MySQL into a formatted string until I ran across this solution that converts a YYYY-MM-DD HH:MM:SS string into a...
6
by: Geoff Cox | last post by:
Hello, at the moment I can add the combined date and time into MySQL using php $dt1 = date("Y-m-d H:i:s"); is it possible to add the date and time separately? I thought it might be
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.