Re: [PHP] Not sure if this is a php problem or a mysql problem

2006-03-29 Thread Angelo Zanetti


Chris wrote:

Paul Goepfert wrote:


Hi all,

I have developed a php functilon that is to return the date +1 from a
Mysql database.  My sql statement is as follows

SELECT dayNum FROM Days Where dayNum = day(curdate())+1;

The function works great on the intended webserver but when placed on
a different mysql server (The one I have using to develop the webpage)
the return variable with the intended SQL statement is not being set. 



What do you get on both servers when you run it manually through 
phpmyadmin or some other tool?


Are they the same mysql version - select version(); ?

Same php version?


why not use the DATE_ADD function from mySQL??

(date,INTERVAL expr type)

eg:

mysql SELECT DATE_ADD('1997-12-31 23:59:59',
- INTERVAL 1 DAY);

hope this helps!

Angelo

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



RE: [PHP] Not sure if this is a php problem or a mysql problem

2006-03-29 Thread Weber Sites LTD
If you want to do it in PHP you can always do :

$Tomorrow = date( Y-m-d, strtotime (1 day ) ) ;

Or more general : http://www.weberdev.com/get_example-292.html

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
SEO Data Monitor http://seo.weberdev.com
 

-Original Message-
From: Paul Goepfert [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 29, 2006 2:20 AM
To: php-general@lists.php.net
Subject: [PHP] Not sure if this is a php problem or a mysql problem

Hi all,

I have developed a php functilon that is to return the date +1 from a Mysql
database.  My sql statement is as follows

SELECT dayNum FROM Days Where dayNum = day(curdate())+1;

The function works great on the intended webserver but when placed on a
different mysql server (The one I have using to develop the webpage) the
return variable with the intended SQL statement is not being set. 
I Think it has something to do with thlis day(curdate()) portion of my sql
statement.  When I had month in place of day I was able to ge a output.
I don't have a problem with year(curdate()) or month(curdate()).  Even
though the functilon works on the final destination webserver I would like
to know why it won't work on my testing server.

Thanks

Paul

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

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



Re: [PHP] Not sure if this is a php problem or a mysql problem

2006-03-28 Thread Chris

Paul Goepfert wrote:

Hi all,

I have developed a php functilon that is to return the date +1 from a
Mysql database.  My sql statement is as follows

SELECT dayNum FROM Days Where dayNum = day(curdate())+1;

The function works great on the intended webserver but when placed on
a different mysql server (The one I have using to develop the webpage)
the return variable with the intended SQL statement is not being set. 


What do you get on both servers when you run it manually through 
phpmyadmin or some other tool?


Are they the same mysql version - select version(); ?

Same php version?

--
Postgresql  php tutorials
http://www.designmagick.com/

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