File: [Platon] / tucniak / db / tdb_init.c (download)
Revision 1.1.1.1 (vendor branch), Fri Nov 11 16:08:26 2005 UTC (18 years, 5 months ago) by koli
Changes since 1.1: +0 -0
lines
Initial import
|
// Copyright (c) 2003,2004,2005 Juraj Kolesár <koli@koli.sk>
#include "tdb.h"
/* init {{{ *******************************************************************/
int tdb_init(T_DB *tdb) {
bool status = FALSE;
tdb->connection = mysql_init(NULL);
tdb->connection = mysql_real_connect(
tdb->connection,
tdb->host,
tdb->user,
tdb->password,
tdb->database,
0, NULL, 0);
if (tdb->connection)
return(__LT_OK);
else
return(__LT_ERR);
}
/* }}} */
/* close {{{ ******************************************************************/
int tdb_close(T_DB *tdb) {
if (tdb->connection) {
mysql_close(tdb->connection);
return(__LT_OK);
} else return(__LT_ERR);
}
/* }}} */
Platon Group <platon@platon.org> http://platon.org/
|