wordpress/wp-content/plugins/sqlite-integration/query.class.php
/**
	 * Method to handl SHOW COLUMN query.
	 *
	 * @access private
	 */
Method to handl SHOW COLUMN query.
@access private
Method to handl SHOW COLUMN query . @access private
private function handle_show_columns_query() {
		$this->_query = str_ireplace(' FULL', '', $this->_query);
		$pattern_like = '/^\\s*SHOW\\s*(COLUMNS|FIELDS)\\s*FROM\\s*(.*)?\\s*LIKE\\s*(.*)?/i';
		$pattern      = '/^\\s*SHOW\\s*(COLUMNS|FIELDS)\\s*FROM\\s*(.*)?/i';
		if (preg_match($pattern_like, $this->_query, $matches)) {
			$table_name   = str_replace("'", "", trim($matches[2]));
			$column_name  = str_replace("'", "", trim($matches[3]));
			$query_string = "SELECT sql FROM sqlite_master WHERE tbl_name='$table_name' AND sql LIKE '%$column_name%'";
			$this->_query = $query_string;
		} elseif (preg_match($pattern, $this->_query, $matches)) {
			$table_name   = $matches[2];
			$query_string = preg_replace($pattern, "PRAGMA table_info($table_name)", $this->_query);
			$this->_query = $query_string;
		}
	}
private function handle_show_columns_query ( ) { $ this -> _query = str_ireplace ( ' FULL' , '' , $ this -> _query ) ; $ pattern_like = '/^\\s*SHOW\\s*(COLUMNS|FIELDS)\\s*FROM\\s*(.*)?\\s*LIKE\\s*(.*)?/i' ; $ pattern = '/^\\s*SHOW\\s*(COLUMNS|FIELDS)\\s*FROM\\s*(.*)?/i' ; if ( preg_match ( $ pattern_like , $ this -> _query , $ matches ) ) { $ table_name = str_replace ( " ' " , " " , trim ( $ matches [ 2 ] ) ) ; $ column_name = str_replace ( " ' " , " " , trim ( $ matches [ 3 ] ) ) ; $ query_string = " SELECT sql FROM sqlite_master WHERE tbl_name=' $ table_name ' AND sql LIKE '% $ column_name %' " ; $ this -> _query = $ query_string ; } elseif ( preg_match ( $ pattern , $ this -> _query , $ matches ) ) { $ table_name = $ matches [ 2 ] ; $ query_string = preg_replace ( $ pattern , " PRAGMA table_info( $ table_name ) " , $ this -> _query ) ; $ this -> _query = $ query_string ; } }
Method to handl SHOW COLUMN query.
Method to handl SHOW COLUMN query .