View Full Version : PP 4.8c incompatible with PHP 4.3.6
June 11th, 2004, 09:51 AM
I've reported on another thread (http://www.photopost.com/members/forum/showthread.php?t=108569) a problem with function mysql_num_rows() that popped up since my host upgraded their PHP to 4.3.6
Now, I'm getting reports from users that are getting the same error in several other places where this function is used, like listing all photos in any category.
These are the errors when I try to list all photos on my site:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /path/to/photopost/showgallery.php on line 409
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /path/to/photopost/showgallery.php on line 416
note paths edited for the sake of reading
I need a fix for these urgent!
June 11th, 2004, 11:16 AM
Well mysql_num_rows is not incompatible with 4.3.6 at least thats what php.net says
That is at least what they say. I dont have 4.3.6 to test on.
June 11th, 2004, 11:23 AM
Well.. maybe not incompatible, pardon my english =)
I can't had count(*) to it because this is the main function that calls the photos from the database in showgallery.php and not a simple function to count the number of rows.
June 11th, 2004, 11:29 AM
What I am saying is given PHP.net documentation mysql_num_rows and * are still valid thats all I am saying.
June 11th, 2004, 11:32 AM
I'm not questioning that!
But that doesn't change the fact that I'm getting these errors all over the place where mysql_num_rows is used.
June 11th, 2004, 03:15 PM
what about replacing mysql_num_rows by mysql_fetch_array?
June 11th, 2004, 03:20 PM
well I just installed bigapache on my home machine with includes php 4.36 and mysql 4.0.18 and everything is fine with mysql_num_rows and Photopost.
Let us check into this more. I will talk with Michael some about this when he gets back in town. Everything I am reading in the php docs etc says no problem with mysql_num_rows and it works fine for me so dont know yet whether its just server specific or whether they updated mysql as well when they updated php and messed something up.
June 11th, 2004, 03:28 PM
I appreciate it!
Let me know if you need access to a phpinfo page.
June 12th, 2004, 10:05 AM
I'm running 4.3.6 and have no problems.
June 12th, 2004, 10:11 AM
Yep there is not a problem with php 4.3.6 and mysql_num_rows. I have installed 4.3.6 and also went back and checked phpinfo pages on some of the last installs I have done and many are running 4.3.6 and some even 4.3.7 with no problems
Has to be an isolated incident where RBL's host messed something up when they updated their php/mysql
rbl you can PM me a test account and url etc and I will take a look ;)
June 30th, 2004, 12:24 AM
Sorry for the delay on this one but it was a very nasty bug to solve.
After a few tries, we have isolated this to a kernel problem. Took a lot of time because the logs were clean: no clues, no traces... nothing.
The problem was constant lost connections to the mysql server. These caused the mysql_num_rows errors in every file that used them. I've kept my changes for the times mysql_num_rows was used to count rows. The COUNT(*) function is better.
As soon as I know anything else about this particular kernel issue, I'll post here. Maybe it would be helpfull for someone.
Anyway, my apologies and thanks to everyone that lost time with this issue but unfortunately this was beyhond my control =(
PS: almost forgot! PP is running on php 4.3.7 with no problem whatsoever =)
June 30th, 2004, 08:15 AM
Understand completely. Server issues and misconfigurations etc can be a biatch.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.