Getting database object name

Login or register to post comments
2 replies [Last post]
LaCeja's picture
Offline
Joined: 11/04/2009

Hi folks. I'm trying to figure out how to get the name of a database object, after it's created. For example,

if ($blnSomeFlag == 'Y')
  $objMyTable = new Mytable1;
else
  $objMyTable = new Mytable2;

is there a property on $objMyTable that will tell me which database object it is?

Thanks.

alex94040's picture
Offline
Joined: 11/06/2008

$className = get_class($myObj);

LaCeja's picture
Offline
Joined: 11/04/2009

Excellent! Thank you Alex!