/[LeafOK_CVS]/lbbs/src/database.c
ViewVC logotype

Annotation of /lbbs/src/database.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Wed Oct 20 07:46:32 2004 UTC (21 years, 5 months ago) by sysadm
Branch: MAIN
Changes since 1.1: +16 -0 lines
Content type: text/x-csrc
*** empty log message ***

1 sysadm 1.1 /***************************************************************************
2     database.c - description
3     -------------------
4     begin : Mon Oct 11 2004
5     copyright : (C) 2004 by Leaflet
6     email : leaflet@leafok.com
7     ***************************************************************************/
8    
9     /***************************************************************************
10     * *
11     * This program is free software; you can redistribute it and/or modify *
12     * it under the terms of the GNU General Public License as published by *
13     * the Free Software Foundation; either version 2 of the License, or *
14     * (at your option) any later version. *
15     * *
16     ***************************************************************************/
17    
18     #include "bbs.h"
19     #include "common.h"
20    
21     MYSQL *
22     db_open ()
23     {
24 sysadm 1.2 MYSQL *db;
25    
26     db = mysql_init(NULL);
27     if (db == NULL)
28     {
29     log_error("mysql_init() failed\n");
30     return NULL;
31     }
32    
33     db = mysql_real_connect(db, DB_host, DB_username, DB_password, DB_database,
34     0, NULL, 0);
35     if (db == NULL)
36     {
37     log_error("mysql_connect() failed\n");
38     return NULL;
39     }
40 sysadm 1.1 }

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1