Re: [PHP-DB] Pages not fully loading

2007-09-22 Thread ioannes
Thanks to all who replied.  There is a lot of undefined index and 
undefined variables when I turn on error reporting.


The error logs show 'file not found' errors in the last 24 hours for 
files that I am sure were never called from any script on my site.  I do 
not understand 'mod_rewrite: maximum number of internal redirects 
reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' 
to increase the limit if neccessary. '


*MAIN error_log:*

[Sat Sep 22 03:21:35 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/header.gif
[Sat Sep 22 03:21:38 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/cat_bullet.gif
[Sat Sep 22 03:21:38 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.
[Sat Sep 22 03:21:38 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/back_pdf.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-pdf.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-sport.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-plus.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/unegruaja.jpg
[Sat Sep 22 03:21:43 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/reklama/panoramasport.jpg
[Sat Sep 22 03:21:43 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/reklama/economist.jpg
[Sat Sep 22 03:21:44 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.
[Sat Sep 22 03:21:44 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.


Does the above mean a segmentation fault as mentioned by Andres?

John

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



Re: [PHP-DB] Pages not fully loading

2007-09-22 Thread ioannes
The problem occurs without session data in the page also.  Buffering is 
off on my php.ini file.


Language Options
output_buffering= Off

I have been told that the MAIN error_log below also shows errors for 
other users on the server, so that does not help particularly.


John

ioannes wrote:
Thanks to all who replied.  There is a lot of undefined index and 
undefined variables when I turn on error reporting.


The error logs show 'file not found' errors in the last 24 hours for 
files that I am sure were never called from any script on my site.  I 
do not understand 'mod_rewrite: maximum number of internal redirects 
reached. Assuming configuration error. Use 'RewriteOptions 
MaxRedirects' to increase the limit if neccessary. '


*MAIN error_log:*

[Sat Sep 22 03:21:35 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/header.gif
[Sat Sep 22 03:21:38 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/cat_bullet.gif
[Sat Sep 22 03:21:38 2007] [error] [client 203.220.217.63] 
mod_rewrite: maximum number of internal redirects reached. Assuming 
configuration error. Use 'RewriteOptions MaxRedirects' to increase the 
limit if neccessary.
[Sat Sep 22 03:21:38 2007] [error] [client 203.220.217.63] 
mod_rewrite: maximum number of internal redirects reached. Assuming 
configuration error. Use 'RewriteOptions MaxRedirects' to increase the 
limit if neccessary.
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/back_pdf.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-pdf.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-sport.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-plus.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/unegruaja.jpg
[Sat Sep 22 03:21:43 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/reklama/panoramasport.jpg
[Sat Sep 22 03:21:43 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/reklama/economist.jpg
[Sat Sep 22 03:21:44 2007] [error] [client 203.220.217.63] 
mod_rewrite: maximum number of internal redirects reached. Assuming 
configuration error. Use 'RewriteOptions MaxRedirects' to increase the 
limit if neccessary.
[Sat Sep 22 03:21:44 2007] [error] [client 203.220.217.63] 
mod_rewrite: maximum number of internal redirects reached. Assuming 
configuration error. Use 'RewriteOptions MaxRedirects' to increase the 
limit if neccessary.


Does the above mean a segmentation fault as mentioned by Andres?

John



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



RE: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Naintara
I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 7:48 PM
To: 'PHP-DB Mailing List'
Subject: [PHP-DB] Notice: A non well formed numeric value encountered

I'm getting the above NOTICE with the following statement:
Echo date('d/m/y',$CTS);

Where $CTS = 2007-09-22 10:09:31

And 31/12/69 is being echoed.


PHP 5.2.1
MYSQL 5.0.37-community-nt via tcp/ip

Thanks in advance for any insight.

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

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



RE: [PHP-DB] Pages not fully loading

2007-09-22 Thread Naintara
Perhaps a faulty mod_rewrite rule or pages/folder setup.
You'll need someone to look at your setup and mod_rewrite rules or if you
want to read up on it 
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html


-Original Message-
From: ioannes [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 3:43 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Pages not fully loading

Thanks to all who replied.  There is a lot of undefined index and 
undefined variables when I turn on error reporting.

The error logs show 'file not found' errors in the last 24 hours for 
files that I am sure were never called from any script on my site.  I do 
not understand 'mod_rewrite: maximum number of internal redirects 
reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' 
to increase the limit if neccessary. '

*MAIN error_log:*

[Sat Sep 22 03:21:35 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/header.gif
[Sat Sep 22 03:21:38 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/cat_bullet.gif
[Sat Sep 22 03:21:38 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.
[Sat Sep 22 03:21:38 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/images/back_pdf.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-pdf.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-sport.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/panorama-plus.jpg
[Sat Sep 22 03:21:42 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/unegruaja.jpg
[Sat Sep 22 03:21:43 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/reklama/panoramasport.jpg
[Sat Sep 22 03:21:43 2007] [error] [client 80.78.74.168] File does not 
exist: /usr/local/apache/htdocs/reklama/economist.jpg
[Sat Sep 22 03:21:44 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.
[Sat Sep 22 03:21:44 2007] [error] [client 203.220.217.63] mod_rewrite: 
maximum number of internal redirects reached. Assuming configuration 
error. Use 'RewriteOptions MaxRedirects' to increase the limit if 
neccessary.

Does the above mean a segmentation fault as mentioned by Andres?

John

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

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



RE: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Stephen Sunderlin
Thank you for your response.

The notice is in the Subject Line of the email:
Notice: A non well formed numeric value encountered

So you are saying I have to convert the current -mm-dd:HH:MM:SS  date
format, to UNIX timestamp value then call Date() to format the UNIX
timestamp as Month, Day, Year?

If so, is it recommended to do that at the database level or the program
level.

I guess it would make sense to convert all dates to UNIX timestamp for
database storage then convert at necessary.

Any insight would be helpful.

Thanks!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:13 AM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 7:48 PM
To: 'PHP-DB Mailing List'
Subject: [PHP-DB] Notice: A non well formed numeric value encountered

I'm getting the above NOTICE with the following statement:
Echo date('d/m/y',$CTS);

Where $CTS = 2007-09-22 10:09:31

And 31/12/69 is being echoed.


PHP 5.2.1
MYSQL 5.0.37-community-nt via tcp/ip

Thanks in advance for any insight.

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

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

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



Re: [PHP-DB] Pages not fully loading

2007-09-22 Thread ioannes
I also get this in my error log, I am not sure what to do with this 
(what side effect?):


PHP Warning:  Unknown(): Your script possibly relies on a session 
side-effect which existed until PHP 4.2.3. Please be advised that the 
session extension does not consider global variables as a source of 
data, unless register_globals is enabled. You can disable this 
functionality and this warning by setting session.bug_compat_42 or 
session.bug_compat_warn to off, respectively.


At the moment, I am observing that if I submit the enquiry form (method 
post), I can get an incomplete page or page not found.  If I refresh, I 
get a blank page like this, which does not derive from the script (eg 
body tag in actual script is body text=#00 leftmargin=0 
topmargin=0 marginwidth=0 marginheight=0 bgcolor=#ff):


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html; 
charset=iso-8859-1/HEAD

BODY/BODY/HTML

refresh again gives page source to the previous stop point,

refresh again gives full page correctly.

However, my host support thinks my script was conflicting with fastCGI 
on my account and have 


changed it back to the normal parser by adding a line to your .htaccess file, 
and your site is running again.
The line I added is 
AddHandler application/x-httpd-php .php


.

Unfortunately this is not quite working,  I am still getting more pages 
across the site loading progressively on each refresh, or showing page 
not found and then loading fully or taking a long time to struggle 
through the progress bar at the end of the browser screen.


John

  


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



RE: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Naintara
That's a good question. 

I'm really not sure about which way is better, but yes, you could use
UNIX_TIMESTAMP() to query a datetime value from a MySQL field, convert it
to the UNIX timestamp value within the query, and then retrieve it in your
record set. 
UNIX_TIMESTAMP() [MySQL function]

Or you could use php to convert a datetime value to UNIX timestamp.
mktime() [php function]

You could store the timestamp value in the database itself, and convert at
will in the program.
So many choices... I really wouldn't know which to recommend, a lot depends
on usage. The datetime column takes more storage than an integer column,
but it's human-readable.

If you mean storing an timestamp integer value in a particular database
field, that should also be fine. 

There are a whole lot of issues with datetime related functions, like DST
(daylight savings time) or timezones, if all that is critical, you may look
into it.
There is a TIMESTAMP field type in MySQL, the usage has changed in MySQL
4.1 and up.
This is useful for recording time/date of db updates.

For usual work, I find that a datetime data type column works for me.
Then, if I know what I will be using the datetime value for, I sometimes
format the date within the query itself using DATE_FORMAT() as I like to
get the results that way rather than change it, of course, if you may be
presenting the datetime value in different ways, or if you want the
flexibility, then use php.

I hope this helps somewhat.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 9:24 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

Thank you for your response.

The notice is in the Subject Line of the email:
Notice: A non well formed numeric value encountered

So you are saying I have to convert the current -mm-dd:HH:MM:SS  date
format, to UNIX timestamp value then call Date() to format the UNIX
timestamp as Month, Day, Year?

If so, is it recommended to do that at the database level or the program
level.

I guess it would make sense to convert all dates to UNIX timestamp for
database storage then convert at necessary.

Any insight would be helpful.

Thanks!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:13 AM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 7:48 PM
To: 'PHP-DB Mailing List'
Subject: [PHP-DB] Notice: A non well formed numeric value encountered

I'm getting the above NOTICE with the following statement:
Echo date('d/m/y',$CTS);

Where $CTS = 2007-09-22 10:09:31

And 31/12/69 is being echoed.


PHP 5.2.1
MYSQL 5.0.37-community-nt via tcp/ip

Thanks in advance for any insight.

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

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

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



FW: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Naintara
Hi again Stephen,

Further on my previous post, if you do store the UNIX timestamp as an
integer value, it should be very efficient, database storage and query
speed, plus giving you ease and flexibility in formatting via php.

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 10:19 PM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

That's a good question. 

I'm really not sure about which way is better, but yes, you could use
UNIX_TIMESTAMP() to query a datetime value from a MySQL field, convert it
to the UNIX timestamp value within the query, and then retrieve it in your
record set. 
UNIX_TIMESTAMP() [MySQL function]

Or you could use php to convert a datetime value to UNIX timestamp.
mktime() [php function]

You could store the timestamp value in the database itself, and convert at
will in the program.
So many choices... I really wouldn't know which to recommend, a lot depends
on usage. The datetime column takes more storage than an integer column,
but it's human-readable.

If you mean storing an timestamp integer value in a particular database
field, that should also be fine. 

There are a whole lot of issues with datetime related functions, like DST
(daylight savings time) or timezones, if all that is critical, you may look
into it.
There is a TIMESTAMP field type in MySQL, the usage has changed in MySQL
4.1 and up.
This is useful for recording time/date of db updates.

For usual work, I find that a datetime data type column works for me.
Then, if I know what I will be using the datetime value for, I sometimes
format the date within the query itself using DATE_FORMAT() as I like to
get the results that way rather than change it, of course, if you may be
presenting the datetime value in different ways, or if you want the
flexibility, then use php.

I hope this helps somewhat.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 9:24 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

Thank you for your response.

The notice is in the Subject Line of the email:
Notice: A non well formed numeric value encountered

So you are saying I have to convert the current -mm-dd:HH:MM:SS  date
format, to UNIX timestamp value then call Date() to format the UNIX
timestamp as Month, Day, Year?

If so, is it recommended to do that at the database level or the program
level.

I guess it would make sense to convert all dates to UNIX timestamp for
database storage then convert at necessary.

Any insight would be helpful.

Thanks!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:13 AM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 7:48 PM
To: 'PHP-DB Mailing List'
Subject: [PHP-DB] Notice: A non well formed numeric value encountered

I'm getting the above NOTICE with the following statement:
Echo date('d/m/y',$CTS);

Where $CTS = 2007-09-22 10:09:31

And 31/12/69 is being echoed.


PHP 5.2.1
MYSQL 5.0.37-community-nt via tcp/ip

Thanks in advance for any insight.

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

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

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

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



RE: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Stephen Sunderlin
I have 3 Timestamp fields in a contact manager that record Edit date, Create
Date and Merge Date.  Doesn't matter to me how it is stored at this point
however when I tried to call it up as just Month, Day, Year (with out the
timestamp) in  php I got the A non well formed numeric value encountered
NOTICE.  

You say I can convert a mysql timestamp value at will in the program (which
I think I am trying to do) and it is not working.  Must I convert it with a
MYSQL function or a PHP function.

Any other ideas?

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 12:49 PM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

That's a good question. 

I'm really not sure about which way is better, but yes, you could use
UNIX_TIMESTAMP() to query a datetime value from a MySQL field, convert it
to the UNIX timestamp value within the query, and then retrieve it in your
record set. 
UNIX_TIMESTAMP() [MySQL function]

Or you could use php to convert a datetime value to UNIX timestamp.
mktime() [php function]

You could store the timestamp value in the database itself, and convert at
will in the program.
So many choices... I really wouldn't know which to recommend, a lot depends
on usage. The datetime column takes more storage than an integer column,
but it's human-readable.

If you mean storing an timestamp integer value in a particular database
field, that should also be fine. 

There are a whole lot of issues with datetime related functions, like DST
(daylight savings time) or timezones, if all that is critical, you may look
into it.
There is a TIMESTAMP field type in MySQL, the usage has changed in MySQL
4.1 and up.
This is useful for recording time/date of db updates.

For usual work, I find that a datetime data type column works for me.
Then, if I know what I will be using the datetime value for, I sometimes
format the date within the query itself using DATE_FORMAT() as I like to
get the results that way rather than change it, of course, if you may be
presenting the datetime value in different ways, or if you want the
flexibility, then use php.

I hope this helps somewhat.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 9:24 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

Thank you for your response.

The notice is in the Subject Line of the email:
Notice: A non well formed numeric value encountered

So you are saying I have to convert the current -mm-dd:HH:MM:SS  date
format, to UNIX timestamp value then call Date() to format the UNIX
timestamp as Month, Day, Year?

If so, is it recommended to do that at the database level or the program
level.

I guess it would make sense to convert all dates to UNIX timestamp for
database storage then convert at necessary.

Any insight would be helpful.

Thanks!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:13 AM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 7:48 PM
To: 'PHP-DB Mailing List'
Subject: [PHP-DB] Notice: A non well formed numeric value encountered

I'm getting the above NOTICE with the following statement:
Echo date('d/m/y',$CTS);

Where $CTS = 2007-09-22 10:09:31

And 31/12/69 is being echoed.


PHP 5.2.1
MYSQL 5.0.37-community-nt via tcp/ip

Thanks in advance for any insight.

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

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

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

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



RE: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Naintara
I think for now you can use the MySQL function DATE_FORMAT()
This would work well for your columns. Look it up in the MySQL reference,
it's very easy to use.

You'll have something like contact_created_date
If a contact was created today, it'll be something like
SELECT DATE_FORMAT(contact_created_date, '%M %d, %Y');

=September 22, 2007

Where contact_created_date is your field.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 10:38 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I have 3 Timestamp fields in a contact manager that record Edit date,
Create
Date and Merge Date.  Doesn't matter to me how it is stored at this point
however when I tried to call it up as just Month, Day, Year (with out the
timestamp) in  php I got the A non well formed numeric value encountered
NOTICE.  

You say I can convert a mysql timestamp value at will in the program (which
I think I am trying to do) and it is not working.  Must I convert it with a
MYSQL function or a PHP function.

Any other ideas?

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 12:49 PM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

That's a good question. 

I'm really not sure about which way is better, but yes, you could use
UNIX_TIMESTAMP() to query a datetime value from a MySQL field, convert it
to the UNIX timestamp value within the query, and then retrieve it in your
record set. 
UNIX_TIMESTAMP() [MySQL function]

Or you could use php to convert a datetime value to UNIX timestamp.
mktime() [php function]

You could store the timestamp value in the database itself, and convert at
will in the program.
So many choices... I really wouldn't know which to recommend, a lot depends
on usage. The datetime column takes more storage than an integer column,
but it's human-readable.

If you mean storing an timestamp integer value in a particular database
field, that should also be fine. 

There are a whole lot of issues with datetime related functions, like DST
(daylight savings time) or timezones, if all that is critical, you may look
into it.
There is a TIMESTAMP field type in MySQL, the usage has changed in MySQL
4.1 and up.
This is useful for recording time/date of db updates.

For usual work, I find that a datetime data type column works for me.
Then, if I know what I will be using the datetime value for, I sometimes
format the date within the query itself using DATE_FORMAT() as I like to
get the results that way rather than change it, of course, if you may be
presenting the datetime value in different ways, or if you want the
flexibility, then use php.

I hope this helps somewhat.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 9:24 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

Thank you for your response.

The notice is in the Subject Line of the email:
Notice: A non well formed numeric value encountered

So you are saying I have to convert the current -mm-dd:HH:MM:SS  date
format, to UNIX timestamp value then call Date() to format the UNIX
timestamp as Month, Day, Year?

If so, is it recommended to do that at the database level or the program
level.

I guess it would make sense to convert all dates to UNIX timestamp for
database storage then convert at necessary.

Any insight would be helpful.

Thanks!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:13 AM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 7:48 PM
To: 'PHP-DB Mailing List'
Subject: [PHP-DB] Notice: A non well formed numeric value encountered

I'm getting the above NOTICE with the following statement:
Echo date('d/m/y',$CTS);

Where $CTS = 2007-09-22 10:09:31

And 31/12/69 is being echoed.


PHP 5.2.1
MYSQL 5.0.37-community-nt via tcp/ip

Thanks in advance for any insight.

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

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

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

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



RE: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Stephen Sunderlin
Naintara,

That worked!

I must have made a syntax error.

Thank you!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 1:34 PM
To: 'Stephen Sunderlin'
Cc: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I think for now you can use the MySQL function DATE_FORMAT()
This would work well for your columns. Look it up in the MySQL reference,
it's very easy to use.

You'll have something like contact_created_date
If a contact was created today, it'll be something like
SELECT DATE_FORMAT(contact_created_date, '%M %d, %Y');

=September 22, 2007

Where contact_created_date is your field.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 10:38 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I have 3 Timestamp fields in a contact manager that record Edit date,
Create
Date and Merge Date.  Doesn't matter to me how it is stored at this point
however when I tried to call it up as just Month, Day, Year (with out the
timestamp) in  php I got the A non well formed numeric value encountered
NOTICE.  

You say I can convert a mysql timestamp value at will in the program (which
I think I am trying to do) and it is not working.  Must I convert it with a
MYSQL function or a PHP function.

Any other ideas?

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 12:49 PM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

That's a good question. 

I'm really not sure about which way is better, but yes, you could use
UNIX_TIMESTAMP() to query a datetime value from a MySQL field, convert it
to the UNIX timestamp value within the query, and then retrieve it in your
record set. 
UNIX_TIMESTAMP() [MySQL function]

Or you could use php to convert a datetime value to UNIX timestamp.
mktime() [php function]

You could store the timestamp value in the database itself, and convert at
will in the program.
So many choices... I really wouldn't know which to recommend, a lot depends
on usage. The datetime column takes more storage than an integer column,
but it's human-readable.

If you mean storing an timestamp integer value in a particular database
field, that should also be fine. 

There are a whole lot of issues with datetime related functions, like DST
(daylight savings time) or timezones, if all that is critical, you may look
into it.
There is a TIMESTAMP field type in MySQL, the usage has changed in MySQL
4.1 and up.
This is useful for recording time/date of db updates.

For usual work, I find that a datetime data type column works for me.
Then, if I know what I will be using the datetime value for, I sometimes
format the date within the query itself using DATE_FORMAT() as I like to
get the results that way rather than change it, of course, if you may be
presenting the datetime value in different ways, or if you want the
flexibility, then use php.

I hope this helps somewhat.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 9:24 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

Thank you for your response.

The notice is in the Subject Line of the email:
Notice: A non well formed numeric value encountered

So you are saying I have to convert the current -mm-dd:HH:MM:SS  date
format, to UNIX timestamp value then call Date() to format the UNIX
timestamp as Month, Day, Year?

If so, is it recommended to do that at the database level or the program
level.

I guess it would make sense to convert all dates to UNIX timestamp for
database storage then convert at necessary.

Any insight would be helpful.

Thanks!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:13 AM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 7:48 PM
To: 'PHP-DB Mailing List'
Subject: [PHP-DB] Notice: A non well formed numeric value encountered

I'm getting the above NOTICE with the following statement:
Echo date('d/m/y',$CTS);

Where $CTS = 2007-09-22 10:09:31

And 31/12/69 is being echoed.


PHP 5.2.1
MYSQL 5.0.37-community-nt via tcp/ip

Thanks in advance for any insight.

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

-- 
PHP Database Mailing 

RE: [PHP-DB] Notice: A non well formed numeric value encountered

2007-09-22 Thread Naintara
Glad I could help.

The problem you faced earlier could happen if you tried to use the
timestamp column values directly in the php date() function. If you see the
database your timestamp columns would have values in the following format
for its timestamp columns:

'1970-01-01 00:00:01'  

This isn't the same as the unix timestamp integer value.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:27 PM
To: 'Naintara'
Cc: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

Naintara,

That worked!

I must have made a syntax error.

Thank you!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 1:34 PM
To: 'Stephen Sunderlin'
Cc: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I think for now you can use the MySQL function DATE_FORMAT()
This would work well for your columns. Look it up in the MySQL reference,
it's very easy to use.

You'll have something like contact_created_date
If a contact was created today, it'll be something like
SELECT DATE_FORMAT(contact_created_date, '%M %d, %Y');

=September 22, 2007

Where contact_created_date is your field.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 10:38 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I have 3 Timestamp fields in a contact manager that record Edit date,
Create
Date and Merge Date.  Doesn't matter to me how it is stored at this point
however when I tried to call it up as just Month, Day, Year (with out the
timestamp) in  php I got the A non well formed numeric value encountered
NOTICE.  

You say I can convert a mysql timestamp value at will in the program (which
I think I am trying to do) and it is not working.  Must I convert it with a
MYSQL function or a PHP function.

Any other ideas?

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 12:49 PM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

That's a good question. 

I'm really not sure about which way is better, but yes, you could use
UNIX_TIMESTAMP() to query a datetime value from a MySQL field, convert it
to the UNIX timestamp value within the query, and then retrieve it in your
record set. 
UNIX_TIMESTAMP() [MySQL function]

Or you could use php to convert a datetime value to UNIX timestamp.
mktime() [php function]

You could store the timestamp value in the database itself, and convert at
will in the program.
So many choices... I really wouldn't know which to recommend, a lot depends
on usage. The datetime column takes more storage than an integer column,
but it's human-readable.

If you mean storing an timestamp integer value in a particular database
field, that should also be fine. 

There are a whole lot of issues with datetime related functions, like DST
(daylight savings time) or timezones, if all that is critical, you may look
into it.
There is a TIMESTAMP field type in MySQL, the usage has changed in MySQL
4.1 and up.
This is useful for recording time/date of db updates.

For usual work, I find that a datetime data type column works for me.
Then, if I know what I will be using the datetime value for, I sometimes
format the date within the query itself using DATE_FORMAT() as I like to
get the results that way rather than change it, of course, if you may be
presenting the datetime value in different ways, or if you want the
flexibility, then use php.

I hope this helps somewhat.

-Original Message-
From: Stephen Sunderlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 9:24 PM
To: 'Naintara'; 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

Thank you for your response.

The notice is in the Subject Line of the email:
Notice: A non well formed numeric value encountered

So you are saying I have to convert the current -mm-dd:HH:MM:SS  date
format, to UNIX timestamp value then call Date() to format the UNIX
timestamp as Month, Day, Year?

If so, is it recommended to do that at the database level or the program
level.

I guess it would make sense to convert all dates to UNIX timestamp for
database storage then convert at necessary.

Any insight would be helpful.

Thanks!

-Original Message-
From: Naintara [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 22, 2007 11:13 AM
To: 'PHP-DB Mailing List'
Subject: RE: [PHP-DB] Notice: A non well formed numeric value encountered

I don't see the NOTICE message.
Perhaps a timezone notice?

Lookup the date() function in the php manual.
The time parameter should be a unix timestamp value, so $CTS should contain
an integer value.
You can also find ways to convert the time value you have to unix
timestamp, in the manual.

[PHP-DB] Database warning may be session is the problem

2007-09-22 Thread Chris Carter

This might look only like a warning message but it has been bugging me since
quite sometime now. Seek expert advice from the members of this forum
please.

Session at the top of the page;

?
session_start();
if(!session_is_registered(emailAddress)){
header(location:store-login.php);
}
$_SESSION['email'] = 'emailAddress'
?

Error on the database:

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on
MySQL result index 5 in thepath/pagename.php on line 132

My code is:

?php
// database information
include ../includes/conf.php;

$query=SELECT * FROM table WHERE email =
'.mysql_real_escape_string($_SESSION['email']). ';
$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
{
$1=mysql_result($result,$i,1);
$2=mysql_result($result,$i,2);
$3=mysql_result($result,$i,3);
$4=mysql_result($result,$i,4);
$5=mysql_result($result,$i,5);
$6=mysql_result($result,$i,6);
$7=mysql_result($result,$i,7);
$8=mysql_result($result,$i,8);
$9=mysql_result($result,$i,9);
$10=mysql_result($result,$i,12);
$11=mysql_result($result,$i,11);
//$sno=mysql_result($result,$i,sno);
//$url=../storeDiscription.php?sno=$sno;
}
?

Please suggest a way out.

Many thanks,

Chris
-- 
View this message in context: 
http://www.nabble.com/Database-warning-may-be-session-is-the-problem-tf4503195.html#a12842959
Sent from the Php - Database mailing list archive at Nabble.com.

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