Hi all,
I'm just getting crazy trying to insert a UNIX_TIMESTAMP in a field using an ADDT form.
I use php4 and mysql 4, and I tried all combination in phpmyadmin for the date field of my table but without success.
I need to store a UNIX_TIMESTAMP in a field so that I can use it with my RSS feed.
The only way to get a UNIX_TIMESTAMP value in a field has been (for me) to set the date field to INT(10) and then editing the record in phpmyadmin and changing the FUNCTION for the date field to UNIX_TIMESTAMP.
But I cannot edit all records (ugh!) manually every time I add a record.
Is there a way to get a UNIX_TIMESTAMP in a table using ADDT or Kollection pro?
TIA
tony
hot to insert a UNIX_TIMESTAMP in a field with an ADDT form?
Re: hot to insert a UNIX_TIMESTAMP in a field with an ADDT f
SOLVED: I have put
as default in the dynamic form and set the field in phpmyadmin as INT (10).
I changed the update transaction too, just to update the unix timestamp when updating the record, so I've put as default of the date field even to the update transaction
HTH
tony
Code: Select all
time()
I changed the update transaction too, just to update the unix timestamp when updating the record, so I've put
Code: Select all
time()
HTH
tony
Re: hot to insert a UNIX_TIMESTAMP in a field with an ADDT f
What you can do to automate the process without any input required from your update form is to set the fieldtype like in the example on the mysql documentation;
This will probably only work with mysql version 4.1 or later.
IStill running on php 4 and mysql 4?
I would seriously suggest you upgrade... You are going to get hacked!!
Code: Select all
CREATE TABLE t (ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP);
CREATE TABLE t (ts TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
DEFAULT CURRENT_TIMESTAMP);
IStill running on php 4 and mysql 4?
I would seriously suggest you upgrade... You are going to get hacked!!