From 0b045d57b2164b5ce003955d79627ae506a153eb Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 17 Apr 2021 17:13:41 -0600 Subject: Change location of config file The config has been moved inside the project dir and .gitignored. This makes the project work on Windows because Windows does not have a /var directory. --- .gitignore | 3 ++- README.md | 4 +++- config.example.ini | 5 +++++ includes/db_inc.php | 10 +--------- 4 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 config.example.ini diff --git a/.gitignore b/.gitignore index 600d2d3..394de92 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.vscode \ No newline at end of file +.vscode +config.ini \ No newline at end of file diff --git a/README.md b/README.md index 29c11a2..2255372 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # cflip.net forums The source code to my first PHP project, a forum system. -The `setup.sql` should set up the database correctly. +## Setup +- Create a `config.ini` file and put your MySQL credentials in (see `config.example.ini`) +- `setup.sql` has the SQL script to set up your database. diff --git a/config.example.ini b/config.example.ini new file mode 100644 index 0000000..c587a63 --- /dev/null +++ b/config.example.ini @@ -0,0 +1,5 @@ +[mysql_credentials] +server = "" +database = "" +user = "" +password = "" \ No newline at end of file diff --git a/includes/db_inc.php b/includes/db_inc.php index 10740d8..b7c361d 100644 --- a/includes/db_inc.php +++ b/includes/db_inc.php @@ -1,13 +1,5 @@