Upgrade to php 5
Posted 12 September 2006 - 01:42 PM
Warning: Invalid argument supplied for foreach() in /usr/local/apache/htdocs/solomon/lib/Db.php on line 1185
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/local/apache/htdocs/solomon/lib/Db.php on line 1175
Warning: Invalid argument supplied for foreach() in /usr/local/apache/htdocs/solomon/lib/Db.php on line 1191
I am assuming it is a difference in the code that needs to be changed from PHP 4 to PHP 5. I have been looking for a list of things that changed between the two versions and I don't find anything. My question is what is going on here. In the "not a valid MySQL resource error" everyone seems to say that is it because it's not pulling information. I know in a few of the pages the code is set for example:
RUN CODE HERE
So I want to check to see if it pulls something and if not do something else... Well I get an error similar to the one above on the line that has the mysql_num_rows line of code. Are there things that I have to code differently in php 5. The web site works 100% on the old server, so I know the code is good. And advice I am lost at where the problem is if there is one... If you want an example of one check out www.missionvina.com.
It appears that it is giving me errors when the information is not there for example. I have a function:
Sometimes I run the function get_info(1) and sometimes I just run it get_info(). Either way i pull info sometimes one way and othertimes I need the argument in (). These errors I just want to dissappear because I know all of the code works as I need it. So is there a way to just turn off the errors so they don't show up? Or do I need to make seperate functions for when I don't want to run the argument for example. Does my code have to be flawless to run on PHP 5?
Posted 12 September 2006 - 02:21 PM
If you're working from a different server and getting "invalid argument" or "invalid resource", I'd question whether you're talking to your database correctly or not. Can you verify that?
Info: PHP Manual
Posted 12 September 2006 - 02:39 PM
$count_confirmations = count_confirmations($_SESSION['info']['SectorID']);
Sometimes when accessing the page the people have a confirmation that is pulled from my database in the count_confirmations function. Othertimes they don't have one, and that is fine, I just want the page to check to see if they did. The web page however, if it runs the functions and finds that there are no confirmations gives me the error, but if there was a confirmation it wouldn't give me the error.
If there is no result for function A
Run this command
It gives me an error when I check to see if there is a result for function A. It's ok if it's NULL, so why the error.
Posted 12 September 2006 - 02:44 PM
Info: PHP Manual
Posted 12 September 2006 - 04:59 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users