Private/Polyfony/Query.php
public function query(
		string $query, 
		$values=null, 
		$table=null
	) {
		// set the main action
		$this->action('QUERY');
		// set the table
		$this->Table = $table;
		// set the query
		$this->Query = $query;
		// set the array of values
		$this->Values = $values;
		// detetect the action
		$action = substr($query, 0, 6);
		// if action can alter a table (INSERT, UPDATE, DELETE)
		if(in_array($action, array('INSERT', 'UPDATE', 'DELETE', 'SELECT'))) {
			// in case of INSERT
			if($action == 'INSERT') {
				// explode after INTO
				list(,$table) = explode('INTO ', $this->Query);
				// isolate the table name
				list($this->Table) = explode(' ', $table);
			}
			// in case of UPDATE
			elseif($action == 'UPDATE') {
				// explode after UPDATE
				list(,$table) = explode('UPDATE ', $this->Query);
				// isolate the table name
				list($this->Table) = explode(' ', $table);
			}
			// in case of DELETE or SELECT
			elseif($action == 'DELETE' || $action == 'SELECT') {
				// explode after FROM 
				list(,$table) = explode('FROM ', $this->Query);
				// isolate the table name
				list($this->Table) = explode(' ', $table);
			}
			// clean the table name from any quotes
			$this->Table = trim($this->Table, '\'/"`');
		}
		// return self to the next method
		return $this;
	}
public function query(
		string $query, 
		$values=null, 
		$table=null
	) {
		// set the main action
		$this->action('QUERY');
		// set the table
		$this->Table = $table;
		// set the query
		$this->Query = $query;
		// set the array of values
		$this->Values = $values;
		// detetect the action
		$action = substr($query, 0, 6);
		// if action can alter a table (INSERT, UPDATE, DELETE)
		if(in_array($action, array('INSERT', 'UPDATE', 'DELETE', 'SELECT'))) {
			// in case of INSERT
			if($action == 'INSERT') {
				// explode after INTO
				list(,$table) = explode('INTO ', $this->Query);
				// isolate the table name
				list($this->Table) = explode(' ', $table);
			}
			// in case of UPDATE
			elseif($action == 'UPDATE') {
				// explode after UPDATE
				list(,$table) = explode('UPDATE ', $this->Query);
				// isolate the table name
				list($this->Table) = explode(' ', $table);
			}
			// in case of DELETE or SELECT
			elseif($action == 'DELETE' || $action == 'SELECT') {
				// explode after FROM 
				list(,$table) = explode('FROM ', $this->Query);
				// isolate the table name
				list($this->Table) = explode(' ', $table);
			}
			// clean the table name from any quotes
			$this->Table = trim($this->Table, '\'/"`');
		}
		// return self to the next method
		return $this;
	}
public function query ( string $ query , $ values = null , $ table = null ) { // set the main action $ this -> action ( 'QUERY' ) ; // set the table $ this -> Table = $ table ; // set the query $ this -> Query = $ query ; // set the array of values $ this -> Values = $ values ; // detetect the action $ action = substr ( $ query , 0 , 6 ) ; // if action can alter a table (INSERT, UPDATE, DELETE) if ( in_array ( $ action , array ( 'INSERT' , 'UPDATE' , 'DELETE' , 'SELECT' ) ) ) { // in case of INSERT if ( $ action == 'INSERT' ) { // explode after INTO list ( , $ table ) = explode ( 'INTO ' , $ this -> Query ) ; // isolate the table name list ( $ this -> Table ) = explode ( ' ' , $ table ) ; } // in case of UPDATE elseif ( $ action == 'UPDATE' ) { // explode after UPDATE list ( , $ table ) = explode ( 'UPDATE ' , $ this -> Query ) ; // isolate the table name list ( $ this -> Table ) = explode ( ' ' , $ table ) ; } // in case of DELETE or SELECT elseif ( $ action == 'DELETE' || $ action == 'SELECT' ) { // explode after FROM  list ( , $ table ) = explode ( 'FROM ' , $ this -> Query ) ; // isolate the table name list ( $ this -> Table ) = explode ( ' ' , $ table ) ; } // clean the table name from any quotes $ this -> Table = trim ( $ this -> Table , '\'/"`' ) ; } // return self to the next method return $ this ; }
passrthu a query with values if needed
passrthu a query with values if needed