I have created a class for writing sql query in which i have used late static binding concept and i am trying to call its insert method in different class to insert the values here is sqlQuery class
class sqlQuery
{
public static $table=" table 1 ";
public static $colum1=" colum1 ";
public static $colum2=" colum2 ";
public static $colum3=" colum3 ";
public static $colum4=" colum4 ";
public $value1=" value1 ";
public $value2=" value2 ";
public function insert( $value1,$value2)
{
echo "INSERT INTO" .static::$table ."(" . static::$colum1 .' , ' .static ::$colum2. ") VALUES('$value1' , '$value2')" ;
}
}
And this is my second class file where i am using insert method from first class what i am trying to do, get the table name and Column from this class using late static binding....please help how can i do this...here is my 2nd class file
class gallery extends logo
{
public $object;
public static $colum1=" status ";
public static $colum2=" order ";
public static $colum3=" colum3 ";
public static $colum4=" colum4 ";
function __construct()
{
parent::__construct();
//$this->object=new sqlQuery();
}
function insert()
{
$query=new sqlQuery();
$query1=new sqlQuery();
$call=$query1->insert('active','10');
}
}
Help me thanks in advance.....