wordpress/wp-content/plugins/sqlite-integration/pdoengine.class.php
/**
	 * Method to execute PDO statement object.
	 *
	 * This function executes query and sets the variables to give back to WordPress.
	 * The variables are class fields. So if success, no return value. If failure, it
	 * returns void and stops.
	 *
	 * @param object $statement of PDO statement
	 * @return boolean
	 */
Method to execute PDO statement object.
This function executes query and sets the variables to give back to WordPress.
The variables are class fields. So if success, no return value. If failure, it
returns void and stops.

@param object $statement of PDO statement
@return boolean
Method to execute PDO statement object . This function executes query and sets the variables to give back to WordPress . The variables are class fields . So if success no return value . If failure it returns void and stops . @param object $statement of PDO statement @return boolean
private function execute_query($statement) {
		$reason  = 0;
		$message = '';
		if (!is_object($statement))
		  return false;
		if (count($this->extracted_variables) > 0) {
			$this->queries[] = "Executing:\n" . var_export($this->extracted_variables, true);
			do {
				if ($this->query_type == 'update' || $this->query_type == 'replace') {
					try {
						$this->beginTransaction();
						$statement->execute($this->extracted_variables);
						$this->commit();
					} catch (PDOException $err) {
						$reason  = $err->getCode();
						$message = $err->getMessage();
						$this->rollBack();
					}
				} else {
					try {
						$statement->execute($this->extracted_variables);
					} catch (PDOException $err) {
						$reason  = $err->getCode();
						$message = $err->getMessage();
					}
				}
			} while (5 == $reason || 6 == $reason);
		} else {
			$this->queries[] = 'Executing: (no parameters)';
			do{
				if ($this->query_type == 'update' || $this->query_type == 'replace') {
					try {
						$this->beginTransaction();
						$statement->execute();
						$this->commit();
					} catch (PDOException $err) {
						$reason  = $err->getCode();
						$message = $err->getMessage();
						$this->rollBack();
					}
				} else {
					try {
						$statement->execute();
					} catch (PDOException $err) {
						$reason  = $err->getCode();
						$message = $err->getMessage();
					}
				}
			} while (5 == $reason || 6 == $reason);
		}
		if ($reason > 0) {
			$err_message = sprintf("Error while executing query! Error message was: %s", $message);
			$this->set_error(__LINE__, __FUNCTION__, $err_message);
			return false;
		} else {
			$this->_results = $statement->fetchAll(PDO::FETCH_OBJ);
		}
		switch ($this->query_type) {
			case 'insert':
			case 'update':
			case 'replace':
				$this->last_insert_id = $this->pdo->lastInsertId();
				$this->affected_rows  = $statement->rowCount();
				$this->return_value   = $this->affected_rows;
			  break;
			case 'select':
			case 'show':
			case 'showcolumns':
			case 'showindex':
			case 'describe':
			case 'desc':
			case 'check':
			case 'analyze':
				$this->num_rows     = count($this->_results);
				$this->return_value = $this->num_rows;
				break;
			case 'delete':
				$this->affected_rows = $statement->rowCount();
				$this->return_value  = $this->affected_rows;
				break;
			case 'alter':
			case 'drop':
			case 'create':
			case 'optimize':
			case 'truncate':
				if ($this->is_error) {
					$this->return_value = false;
				} else {
					$this->return_value = true;
				}
			  break;
		}
	}
private function execute_query ( $ statement ) { $ reason = 0 ; $ message = '' ; if ( ! is_object ( $ statement ) ) return false ; if ( count ( $ this -> extracted_variables ) > 0 ) { $ this -> queries [ ] = " Executing: \n " . var_export ( $ this -> extracted_variables , true ) ; do { if ( $ this -> query_type == 'update' || $ this -> query_type == 'replace' ) { try { $ this -> beginTransaction ( ) ; $ statement -> execute ( $ this -> extracted_variables ) ; $ this -> commit ( ) ; } catch ( PDOException $ err ) { $ reason = $ err -> getCode ( ) ; $ message = $ err -> getMessage ( ) ; $ this -> rollBack ( ) ; } } else { try { $ statement -> execute ( $ this -> extracted_variables ) ; } catch ( PDOException $ err ) { $ reason = $ err -> getCode ( ) ; $ message = $ err -> getMessage ( ) ; } } } while ( 5 == $ reason || 6 == $ reason ) ; } else { $ this -> queries [ ] = 'Executing: (no parameters)' ; do { if ( $ this -> query_type == 'update' || $ this -> query_type == 'replace' ) { try { $ this -> beginTransaction ( ) ; $ statement -> execute ( ) ; $ this -> commit ( ) ; } catch ( PDOException $ err ) { $ reason = $ err -> getCode ( ) ; $ message = $ err -> getMessage ( ) ; $ this -> rollBack ( ) ; } } else { try { $ statement -> execute ( ) ; } catch ( PDOException $ err ) { $ reason = $ err -> getCode ( ) ; $ message = $ err -> getMessage ( ) ; } } } while ( 5 == $ reason || 6 == $ reason ) ; } if ( $ reason > 0 ) { $ err_message = sprintf ( " Error while executing query! Error message was: %s " , $ message ) ; $ this -> set_error ( __LINE__ , __FUNCTION__ , $ err_message ) ; return false ; } else { $ this -> _results = $ statement -> fetchAll ( PDO :: FETCH_OBJ ) ; } switch ( $ this -> query_type ) { case 'insert' : case 'update' : case 'replace' : $ this -> last_insert_id = $ this -> pdo -> lastInsertId ( ) ; $ this -> affected_rows = $ statement -> rowCount ( ) ; $ this -> return_value = $ this -> affected_rows ; break ; case 'select' : case 'show' : case 'showcolumns' : case 'showindex' : case 'describe' : case 'desc' : case 'check' : case 'analyze' : $ this -> num_rows = count ( $ this -> _results ) ; $ this -> return_value = $ this -> num_rows ; break ; case 'delete' : $ this -> affected_rows = $ statement -> rowCount ( ) ; $ this -> return_value = $ this -> affected_rows ; break ; case 'alter' : case 'drop' : case 'create' : case 'optimize' : case 'truncate' : if ( $ this -> is_error ) { $ this -> return_value = false ; } else { $ this -> return_value = true ; } break ; } }
Method to execute PDO statement object.
Method to execute PDO statement object .
//generate the results that $wpdb will want to see //case "foundrows":