heres my query

$sql = "insert into ctnt_inf (title,
body,summary,date_time, day, month, year ) " .
                                "values ('" . $_POST['title']. "','" .
$_POST['body'] . "','" . $_POST['summary'] . "'," .
time() . ", " . date("d"). ", " . date("m"). ", " .
date("Y"). " ) ";\

n i get the day month n year in my database

hope it helps :)

luck ....

toby .....




 
--- Davy Obdam <[EMAIL PROTECTED]> wrote: > Hi John,
> 
> How do u use UNIX_TIMESTAMP or DATE_FORMAT in your
> query. My query now
> looks like this:
> 
> "SELECT * FROM guestbook2002 ORDER BY entryID DESC
> LIMIT $entry, $show";
> 
> Can u help me;-) Thanks for your time
> 
> Best regards,
>  
> Davy Obdam,
> mailto:[EMAIL PROTECTED]
> 
> 
> -----Original Message-----
> From: John W. Holmes
> [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, October 06, 2002 3:31 PM
> To: 'Davy Obdam'; [EMAIL PROTECTED];
> [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: [PHP-WIN] RE: [PHP] Re: Using date()
> function
> 
> 
> > Using $entry_date = date('l, d F Y
> H:i:s',$sql['date']); now gives me 
> > back Tuesday, 19 January 2038 04:14:07 with ever
> entry. $sql['date']
> is
> > a TIMESTAMP and looks like this 20021006141256 in
> the datebase. It 
> > should give me Sunday, 06 October 2002 14:12:56..?
> Wierd eh? Do u know
> a
> > solution?
> 
> No, not weird. MySQL uses a timestamp in the
> YYYYMMDDHHMMSS format.
> Date() is expecting a UNIX timestamp, which is the
> number of seconds
> since Jan 1, 1970. 
> 
> So... you can either use DATE_FORMAT() in your
> query, with is the MySQL
> equivalent of date(). Look up the format in the
> manual. Or, you can use
> UNIX_TIMESTAMP() in your query to select out the
> unix timestamp instead
> of the mysql timestamp, and then use that value
> within date() in your
> PHP script.
> 
> ---John Holmes...
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to