Skip to content

Commit 4e2bb14

Browse files
committed
rename database file
1 parent fb9eff9 commit 4e2bb14

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
cb_config.php
2+
users.db
23
cb_users.db
34
points.log

cb_functions.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,12 @@ function mysqlconn($user,$pass,$host,$port,$database) {
241241
if(!mysql_select_db($database,$mysql)) {
242242
die('Can not access database!');
243243
}
244-
}
244+
}
245+
246+
const DB_FILE = 'users.db';
245247

246248
function get_db() {
247-
$ret = unserialize(file_get_contents('cb_users.db'));
249+
$ret = unserialize(file_get_contents(DB_FILE));
248250
// global $mysql;
249251
// $ret = array();
250252
// $res = mysql_query('SELECT * FROM `users`');
@@ -267,7 +269,7 @@ function save_db() {
267269
// global $mysql;
268270
global $locked;
269271
if($locked) { return; }
270-
file_put_contents('cb_users.db',serialize($users));
272+
file_put_contents(DB_FILE,serialize($users));
271273
// mysql_query('TRUNCATE `users`');
272274
// foreach($users as $nick => $data) {
273275
// $query = 'INSERT INTO `users` ';

0 commit comments

Comments
 (0)