RE: [PHP] mysql/php date functions..

2005-09-26 Thread Chrome
TECTED] Sent: 26 September 2005 19:46 To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] mysql/php date functions.. john... that appears to be it!! although i would have assumes it would have done a most significant bit fill with 0's... so my question also comes down t

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
Chris W. Parker wrote: John Nichel on Monday, September 26, 2005 12:43 PM said: I don't convert it. I store the UNIX timestamp in an INT(11) column. This is going to be a basic question I'm sure but why INT and not VARCHAR? Is it simply because a timestamp is

Re: [PHP] mysql/php date functions..

2005-09-26 Thread Kristen G. Thorson
tamp var ->> the php var? thanks bruce -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 12:38 PM To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] mysql/php date functions.. so you play with the time/date vars on the p

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Chris W. Parker
John Nichel on Monday, September 26, 2005 12:43 PM said: > I don't convert it. I store the UNIX timestamp in an INT(11) column. This is going to be a basic question I'm sure but why INT and not VARCHAR? Is it simply because a timestamp is a number? Chris. -- PH

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: or.. better yet. if i do a php -> time(), i get a unix_timestamp var. how do you guys store this in mysql. you can't simply do an insert into a mysql/timestamp var. so how do you convert it? I don't convert it. I store the UNIX timestamp in an INT(11) column. also, once you hav

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
p var? thanks bruce -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 12:38 PM To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] mysql/php date functions.. so you play with the time/date vars on the php side, and then simply

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
John Nichel [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:48 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date functions.. bruce wrote: > john... > > that appears to be it!! although i would have assumes it would have done a > most significant bit fill with

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Jim Moseby
> -Original Message- > From: bruce [mailto:[EMAIL PROTECTED] > Sent: Monday, September 26, 2005 2:46 PM > To: 'John Nichel'; php-general@lists.php.net > Subject: RE: [PHP] mysql/php date functions.. > > > john... > > that appears to be it!! a

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: john... that appears to be it!! although i would have assumes it would have done a most significant bit fill with 0's... so my question also comes down to .. do i use the php date functions for date/time manipulation.. or do i use the mysql functions any thoughts/suggestions..

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
bruce -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:19 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date functions.. bruce wrote: > thanks... > > but that's not it john... i'm not worried about creatin

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
but that still doesn't explain why i can't slam some value directly into the timestamp var within the mysql tbl... -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:15 AM To: php-general@lists.php.net Subject: RE: [PHP] mysq

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: thanks... but that's not it john... i'm not worried about creating the sql_statement in the php... i'm concerned that i can't seem to craft/create a basic sql cmd within mysql to get a value (other than NOW()) to work... if i do (from mysql) -->> insert into foo (id, time) values

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Chris W. Parker
bruce on Monday, September 26, 2005 11:13 AM said: > i'm concerned that i can't seem to craft/create a basic sql cmd > within mysql to get a value (other than NOW()) to work... [snip] > my question is why??? MySQL timestamps are different from UNIX timestamps. Chr

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
D] Sent: Monday, September 26, 2005 11:00 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date functions.. bruce wrote: > how can i create a mysql sql statement to insert a php 'time()' into mysql? > > i've got the mysql var 't1, timestamp' but i can

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
d, time) values (2, 33), it doesn't work... if i -->> insert into foo (id, time) values (2, NOW()), it works!!... my question is why??? -bruce -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:00 AM To: php-general@lists.php.

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: how can i create a mysql sql statement to insert a php 'time()' into mysql? i've got the mysql var 't1, timestamp' but i can't figure out how to do an insert $q = time(); $sql = sprintf("insert into foo (id, ctime) values(%d, %???), $id, $q); can't figure out how to get this to wo

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
so what's the basic part i'm missing??!! -bruce -Original Message- From: Silvio Porcellana [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 8:51 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date functions.. Jim Moseby wrote: > > Hi Bruce! > > MySQ

Re: [PHP] mysql/php date functions..

2005-09-26 Thread Silvio Porcellana
Jim Moseby wrote: > > Hi Bruce! > > MySQL and PHP both have extensive built-in date functions that are clearly > documented and extraordinarily easy to use. For the vast majority of > situations, there is no need to manually write any custom date-handling > code. The decision to use MySQL or PHP

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Jim Moseby
> -Original Message- > From: bruce [mailto:[EMAIL PROTECTED] > Sent: Monday, September 26, 2005 11:12 AM > To: php-general@lists.php.net > Subject: [PHP] mysql/php date functions.. > > > hi... > > can anybody point me to a good/basic tutorial (tested) for > php/mysql date > functions...