mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
27 lines
493 B
C++
27 lines
493 B
C++
#include "mysql_query_result.h"
|
|
|
|
#include <cstdio>
|
|
|
|
bool MysqlQueryResult::next_row() {
|
|
current_row = mysql_fetch_row(result);
|
|
|
|
//null if no result
|
|
return current_row;
|
|
}
|
|
|
|
const char* MysqlQueryResult::get_cell(const int index) {
|
|
if (!current_row)
|
|
return "";
|
|
|
|
return current_row[index];
|
|
}
|
|
|
|
MysqlQueryResult::MysqlQueryResult() : QueryResult() {
|
|
result = nullptr;
|
|
}
|
|
|
|
MysqlQueryResult::~MysqlQueryResult() {
|
|
if(result) {
|
|
mysql_free_result(result);
|
|
}
|
|
} |