44 lines
991 B
Plaintext
44 lines
991 B
Plaintext
<?php
|
|
|
|
/*
|
|
db.php
|
|
OpenLog Online Logbook
|
|
Copyright (C) 2025 Rod Wright
|
|
|
|
SPDX-License-Identifier: GPL-2.0
|
|
*/
|
|
|
|
/*
|
|
************************************************************************
|
|
** WARNING! This file is automatically generated during installation **
|
|
** DO NOT EDIT **
|
|
************************************************************************
|
|
*/
|
|
$appname="APPNAME";
|
|
$dbname="DBNAME";
|
|
$username="DBUSER";
|
|
$dbpass="DBPASS";
|
|
|
|
function dberrmsg($dbname) {
|
|
echo "
|
|
<html>
|
|
<head>
|
|
<title>Database Error!</title>
|
|
</head>
|
|
<body>
|
|
Could not connect to the $dbname database. Please ensure the MySQL server is running. If this is
|
|
the first time you have used $appname, please consult the INSTALL file included in the distribution.
|
|
</body>
|
|
</html>
|
|
";
|
|
exit();
|
|
}
|
|
|
|
$db=@mysqli_connect("localhost",$username,$dbpass,$dbname);
|
|
if (mysqli_errno($db)) {
|
|
dberrmsg($dbname);
|
|
}
|
|
|
|
|
|
?>
|