Implements a MySQL version of the Query database query class.  
 More...
#include <arc/MysqlWrapper.h>
 | 
| 
  | MySQLQuery (Database *db) | 
|   | 
| virtual int  | get_num_colums () | 
|   | Get the column number in the query result.  More...
  | 
|   | 
| virtual int  | get_num_rows () | 
|   | Get the row number in the query result.  More...
  | 
|   | 
| virtual bool  | execute (const std::string &sqlstr) | 
|   | Execute the query.  More...
  | 
|   | 
| virtual QueryRowResult  | get_row (int row_number) const | 
|   | Get the value of one row in the query result.  More...
  | 
|   | 
| virtual QueryRowResult  | get_row () const | 
|   | Get the value of one row in the query result.  More...
  | 
|   | 
| virtual std::string  | get_row_field (int row_number, std::string &field_name) | 
|   | Get the value of one specific field in one specific row.  More...
  | 
|   | 
| virtual bool  | get_array (std::string &sqlstr, QueryArrayResult &result, std::vector< std::string > &arguments) | 
|   | Query the database by using some parameters into sql sentence.  More...
  | 
|   | 
|   | Query () | 
|   | Default constructor.  More...
  | 
|   | 
|   | Query (Database *db) | 
|   | Constructor.  More...
  | 
|   | 
| virtual  | ~Query () | 
|   | Deconstructor.  More...
  | 
|   | 
Implements a MySQL version of the Query database query class. 
 
◆ execute()
  
  
      
        
          | virtual bool Arc::MySQLQuery::execute  | 
          ( | 
          const std::string &  | 
          sqlstr | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
Execute the query. 
- Parameters
 - 
  
    | sqlstr | The sql sentence used to query  | 
  
   
Implements Arc::Query.
 
 
◆ get_array()
  
  
      
        
          | virtual bool Arc::MySQLQuery::get_array  | 
          ( | 
          std::string &  | 
          sqlstr,  | 
         
        
           | 
           | 
          QueryArrayResult &  | 
          result,  | 
         
        
           | 
           | 
          std::vector< std::string > &  | 
          arguments  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
virtual   | 
  
 
Query the database by using some parameters into sql sentence. 
An example sentence: "select table.value from table where table.name = ?" 
- Parameters
 - 
  
    | sqlstr | The sql sentence with some parameters marked with "?".  | 
    | result | The result in an array which includes all of the value in query result.  | 
    | arguments | The argument list which should exactly correspond with the parameters in the sql sentence.  | 
  
   
Implements Arc::Query.
 
 
◆ get_num_colums()
  
  
      
        
          | virtual int Arc::MySQLQuery::get_num_colums  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
Get the column number in the query result. 
Implements Arc::Query.
 
 
◆ get_num_rows()
  
  
      
        
          | virtual int Arc::MySQLQuery::get_num_rows  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
Get the row number in the query result. 
Implements Arc::Query.
 
 
◆ get_row() [1/2]
  
  
      
        
          | virtual QueryRowResult Arc::MySQLQuery::get_row  | 
          ( | 
          int  | 
          row_number | ) | 
           const | 
         
       
   | 
  
virtual   | 
  
 
Get the value of one row in the query result. 
- Parameters
 - 
  
    | row_number | The number of the row  | 
  
   
- Returns
 - A vector includes all the values in the row 
 
Implements Arc::Query.
 
 
◆ get_row() [2/2]
  
  
      
        
          | virtual QueryRowResult Arc::MySQLQuery::get_row  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
virtual   | 
  
 
Get the value of one row in the query result. 
The row number will be automatically increased each time the method is called. 
Implements Arc::Query.
 
 
◆ get_row_field()
  
  
      
        
          | virtual std::string Arc::MySQLQuery::get_row_field  | 
          ( | 
          int  | 
          row_number,  | 
         
        
           | 
           | 
          std::string &  | 
          field_name  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
virtual   | 
  
 
Get the value of one specific field in one specific row. 
- Parameters
 - 
  
    | row_number | The row number inside the query result  | 
    | field_name | The field name for the value which will be return  | 
  
   
- Returns
 - The value of the specified filed in the specified row 
 
Implements Arc::Query.
 
 
The documentation for this class was generated from the following file: