Re: cant insert unix timestamp into mysql :( - help!
| From: | Joe Stump | Date: | Sat, 18 Nov 2000 04:09:25 +0000 |
| Subject: | Re: cant insert unix timestamp into mysql :( - help! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26023@lists.php.net to get a copy of this message | ||
On Fri, Nov 17, 2000 at 08:03:46PM -0800, Sandeep Hundal wrote:
> Hey ppl,
>
> I've spent half the day on this, and I still can't get it to work.
> All i want is to insert a unix timestamp into mysql, and then pull ut
> out and format it with date function.
> This is how the code looks so far:
>
> $query = "INSERT into $usertable VALUES (NULL, time()
> ,'$title','$author','$dept')";
$query = "INSERT INTO $usertable VALUES
(NULL,".time().",'$title','$author','
$dept')";
--Joe
>
> but that just puts "0" into the column, which is defined as:
> time int(11) NOT NULL,
>
> what am i doing wrong??
>
>
>
> I intend to print out the data with
>
> echo " $title <br> $author <br> posted by the $dept dept.
> on date ("d M, H:i" ,time());
> ";
>
> If the second bit workable??
>
> thanks for any help!!
>
> /sunny
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Calendar - Get organized for the holidays!
> http://calendar.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
================================================================================
= Joe Stump joestump98@yahoo.com http://www.miester.org =
================================================================================
"Real programmers don't comment their code.
It was hard to write, it should be hard to understand."