Commit 98af98a7 authored by Aleksey Vinogradov's avatar Aleksey Vinogradov Committed by Pavel Vainerman

исправлены ошибки

parent 722aef0d
......@@ -30,7 +30,8 @@ using namespace std;
DBInterface::DBInterface():
result(0),
lastQ(""),
queryok(false)
queryok(false),
connected(false)
{
mysql = new MYSQL();
}
......@@ -52,9 +53,11 @@ bool DBInterface::connect( const string host, const string user, const string ps
{
cout << error() << endl;
mysql_close(mysql);
connected = false;
return false;
}
connected = true;
return true;
}
// -----------------------------------------------------------------------------------------
......@@ -108,7 +111,7 @@ bool DBInterface::nextRecord()
if( !mysql || !result || !queryok )
return false;
if( Row == mysql_fetch_row(result) )
if( Row = mysql_fetch_row(result) )
return true;
return false;
......@@ -219,7 +222,8 @@ bool DBInterface::ping()
{
if(!mysql)
return false;
if(!connected)
return false;
// внимание mysql_ping возвращает 0
// если всё хорошо.... (поэтому мы инвертируем)
return !mysql_ping(mysql);
......
......@@ -87,6 +87,7 @@ class DBInterface
MYSQL *mysql;
string lastQ;
bool queryok; // успешность текущего запроса
bool connected;
};
// ----------------------------------------------------------------------------------
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment