PEAR Unknown class passed as parameter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bijeshmg
Forum Newbie
Posts: 5
Joined: Sun Oct 08, 2006 2:45 am

PEAR Unknown class passed as parameter

Post by bijeshmg »

Hi,
I am new to PEAR. i am getting an error when i try to run my application in php5


In /var/www/vhost/www.xtimesheet.co.uk/PEAR/HTML/QuickForm/select.php, line: 449
Unknown class passed as parameter
Please help me to sort it out.

I am using php5 + MySQL 5
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Hi.
May we see some code?
bijeshmg
Forum Newbie
Posts: 5
Joined: Sun Oct 08, 2006 2:45 am

Post by bijeshmg »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

function load(&$options, $param1=null, $param2=null, $param3=null, $param4=null)
    {
        switch (true) {
            case is_array($options):
                return $this->loadArray($options, $param1);
                break;
            case (is_a($options, 'db_result')):
                return $this->loadDbResult($options, $param1, $param2, $param3);
                break;
            case (is_string($options) && !empty($options) || is_subclass_of($options, "db_common")):  //  =>Line 449
                return $this->loadQuery($options, $param1, $param2, $param3, $param4);
                break;
        }
    }
In my server allow_call_time_pass_reference is off.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
bijeshmg
Forum Newbie
Posts: 5
Joined: Sun Oct 08, 2006 2:45 am

Post by bijeshmg »

it is working fine in php4. but showing this error in php5
Any problem with php5 and quickform?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

bijeshmg wrote:it is working fine in php4. but showing this error in php5
Any problem with php5 and quickform?
There's http://pear.php.net/package/HTML_QuickForm2[quote]PHP5 rewrite of HTML_QuickForm package[/quote]
But I guess the problem is somewhere else. Only guessing.

please try

Code: Select all

function myErrorHandler($errno, $errstr, $errfile, $errline) {
	echo $errstr, "<br />\n";
	foreach(debug_backtrace() as $s) {
		if (isset($s['file'])) {
			echo $s['file'], ':', $s['line'], "<br />\n";
		}
	}	
}
set_error_handler('myErrorHandler');

$form = new HTML_QuickForm('personalinfo', 'post');
if ($refid && $do_action!='save') {
...
please post the output and and mark the lines of your code mentioned in the output.
bijeshmg
Forum Newbie
Posts: 5
Joined: Sun Oct 08, 2006 2:45 am

Post by bijeshmg »

Code here
Last edited by bijeshmg on Mon Oct 09, 2006 12:06 am, edited 1 time in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

do not pass '' for "no options" but null

Code: Select all

$s = &$form->createElement('select','frm[selPostalState]','County', null,'class="formitem" onchange="OnKeyPress()"');
bijeshmg
Forum Newbie
Posts: 5
Joined: Sun Oct 08, 2006 2:45 am

Post by bijeshmg »

Many Many Thanks... It is working...
Post Reply