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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.