Jump to content

error question


dennismonsewicz

Recommended Posts

here is the function

 

$d = $_GET['db'];

class TableAttDeductible extends JTable
{
switch($d) {
	case "phoneplan":
		var $rowid = null;
		var $make = null;
		var $model = null;
		var $deductible = null;
		var $published = 0;
	break;

	case "plan_by_state":
		var $rowid = null;
		var $planid = null;
		var $planmakeid = null;
		var $planmodel = null;
		var $plantier = null;
		var $plandeductible = null;
		var $insurance_only_premium = null;
		var $insurance_warranty_premium = null;
		var $warranty_only_premium = null;
		var $published = 0;
	break;
}


function __construct(&$d)
{
	parent::__construct( '#__' . $d, 'rowid', $d );
}
}

Link to comment
https://forums.phpfreaks.com/topic/135375-error-question/#findComment-705123
Share on other sites

You need to define the variables outside of that switch then possible have a function and given what d is define them in that function. The function should probably be called within the constructor.

 

But what you are trying to do is make the class have dynamic variables. I think you just need to write 2 separate classes, as I do not think that is "kosher"

Link to comment
https://forums.phpfreaks.com/topic/135375-error-question/#findComment-705133
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.