Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
d7818975
Commit
d7818975
authored
May 19, 2011
by
Aleksey Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
исправлены ошибки
parent
806633ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
DBInterface.cc
Utilities/DBServer-MySQL/DBInterface.cc
+7
-4
DBInterface.h
Utilities/DBServer-MySQL/DBInterface.h
+1
-0
No files found.
Utilities/DBServer-MySQL/DBInterface.cc
View file @
d7818975
...
...
@@ -30,7 +30,8 @@ using namespace std;
DBInterface
::
DBInterface
()
:
result
(
0
),
lastQ
(
""
),
queryok
(
false
)
queryok
(
false
),
connected
(
false
)
{
mysql
=
new
MYSQL
();
}
...
...
@@ -52,9 +53,10 @@ 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 +110,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 +221,8 @@ bool DBInterface::ping()
{
if
(
!
mysql
)
return
false
;
if
(
!
connected
)
return
false
;
// внимание mysql_ping возвращает 0
// если всё хорошо.... (поэтому мы инвертируем)
return
!
mysql_ping
(
mysql
);
...
...
Utilities/DBServer-MySQL/DBInterface.h
View file @
d7818975
...
...
@@ -87,6 +87,7 @@ class DBInterface
MYSQL
*
mysql
;
string
lastQ
;
bool
queryok
;
// успешность текущего запроса
bool
connected
;
};
// ----------------------------------------------------------------------------------
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment