RE: [PHP-DB] Date problem: data is current as of yesterday

2004-07-03 Thread Ford, Mike [LSS]
-Original Message-
From: Karen Resplendo
To: [EMAIL PROTECTED]
Sent: 02/07/04 19:36
Subject: [PHP-DB] Date problem: data is current as of yesterday

The database queries all the sources at night after everyone has gone
home. That means the data was current as of yesterday. This little
snippet below returns yesterday's date, except that the first day of the
month returns 0 for the day. Now, I know why this is happening, but I
can't find out how to fix it (in VBA or SQL Server I would just say,
date()-1:
 
$today = getdate(); 
$month = $today['month'] ; 
$mday = $today['mday'] -1; 
$year = $today['year']; 
echo Data is current  as of  b$month $mday, $year/bbr;

--

The mktime() function is your friend for this kind of date arithmetic. For
example, this is one possible way to do what you want:

  $yesterday = mktime(12, 0, 0, $today['mon'], $today['mday']-1,
$today['year']);
  echo Data is current as of b.date(F j, Y, $yesterday);

(Note the use of time 12:00:00 to avoid daylight savings oddities!)

The examples on the date() and mktime() manual pages may suggest other
possibilities to you.

Cheers!

Mike
 


-
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

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



Re: [PHP-DB] Multiple MSSQL Connections

2004-07-03 Thread Robert Twitty
If this is the problem, then you should try the odbtp/mssql hybrid
extension, php_odbtp_mssql.dll.  It is thread-safe, and is available at
http://odbtp.sourceforge.net.

-- bob

On Fri, 2 Jul 2004, Frank M. Kromann wrote:

 That depends on the SAPI you are using. With CGI or FastCGI there is no
 problem but with ISAPI or Apache module you might get problems, as the
 DBLIB library used to build the extension is not thread safe.

 - Frank


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



[PHP-DB] MySQL variable question

2004-07-03 Thread Chris Payne
Hi there everyone,

 

I'm using MySQL 4's built-in Boolean handling abilities with PHP 4 which
works wonderfully, but I need to change:

 

ft_min_word_len

 

to be 3 characters instead of 4 for fulltext indexing, how can I change this
as words such as cat etc ... are not showing up in my PHP search engine and
I need them to.

 

I know I have to edit ft_min_word_len to show 3 instead of 4, but what file
do I edit?  (Sorry to sound dumb but I haven't reconfigured MySQL before).

 

Thanks everyone.

 

Chris



Re: [PHP-DB] MySQL variable question

2004-07-03 Thread John W. Holmes
Chris Payne wrote:
I'm using MySQL 4's built-in Boolean handling abilities with PHP 4 which
works wonderfully, but I need to change:
ft_min_word_len
See here: http://dev.mysql.com/doc/mysql/en/Option_files.html
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php