List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:November 14 2001 8:36pm
Subject:Re: Timestamp allways zero zero
View as plain text  
The whole point of a time stamp is that you do NOT insert its value.
Leave it out.

Olav Drageset wrote:

> Professionals!
> I cannot get timestamp to contain a time value different from zero.
> According to another mailing this shall happen when something is done wrong
> I am completely new to databases. I am initiating the database tables from a php 
> page.
> Can anyone tel me what I am doing wrong??
> Thank you.
> 
> Vreating table is like this:
> 
> $sql  = "CREATE TABLE domains (";
> //En record for hvert navnedomene
> $sql .= "dNbr INTEGER UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,";
> $sql .= "dName CHAR(25) NOT NULL,";
> $sql .= "payPrYr SMALLINT DEFAULT 0 NOT NULL,";
> $sql .= "nextPayDay DATE NULL,";
> $sql .= "members SMALLINT DEFAULT 0 NOT NULL, ";
> $sql .= "noPayMembers SMALLINT DEFAULT 0 NOT NULL,";
> $sql .= "timeChanged TIMESTAMP (14),";
> $sql .= "timeCreated TIMESTAMP (14),";
> $sql .= "INDEX domain(dName))";
> 
> if (!$sql_result = mysql_query($sql,$connection) ) 
> {echo "<P>query1: "; echo mysql_error();} 
> else {echo"<P>query1: domains ok"; 
> 
> 
> this is one variant of writing to table:
> 
> $tid = "NOW(YY-MM-DD HH:MM:SS)";
> $sql = "INSERT INTO domains ( dName, payPrYr, nextPayDay,timeChanged, 
> timeCreated ) ";   
> $sql .= "VALUES ('$domainName', '$payPerYear', '$nxtPayDay', '$tid', 
> '$tid' );";
> if (!$sql_result = mysql_query($sql,$connection) ) 
> {echo "<P>query1: "; echo mysql_error();} 
> else {
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread91283@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 

Thread
Timestamp allways zero zeroOlav Drageset14 Nov
  • Re: Timestamp allways zero zeroJason Wong14 Nov
  • Re: Timestamp allways zero zeroCarl Troein14 Nov
  • Re: Timestamp allways zero zeroGerald Clark14 Nov
Re: Timestamp allways zero zeroChris Cooper14 Nov