Skip to content

Commit

Permalink
🖊Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
hikariyo committed Apr 15, 2022
1 parent 69ddd74 commit 5d46485
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
34 changes: 33 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,42 @@ A web game: EatKano

## Features

A simple ranking list(day/week/month) is provided **not recommended**.
A simple ranking list(day/week/month) is provided.

You can delete all the sql/php files if you don't need them.

## Required
+ MySQL 5+
+ PHP 5+

## Usage

Follow these few steps to configure the database for ranking list.

1. Create your own database and execute the script provided(e.g. use `kano` as database name).

```sql
CREATE DATABASE kano DEFAULT CHARSET=utf8;
USE kano;
SOURCE kano.sql;
```

2. Change the code in `conn.php`, which contains your database info, and its content is here.

```php
<?php
// Change this to your own configuration
$link = new mysqli('localhost','NAME','PASSWORD','kano');
mysqli_set_charset($link, 'utf8');
if ($link->connect_error) {
die("Failed to connect: " . $conn->connect_error);
}
$ranking = "kano_rank";
```




## Others

Please star us~
Expand Down
7 changes: 4 additions & 3 deletions conn.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
$link = new mysqli('localhost','用户名','密码','数据库名');
// Change this to your own configuration
$link = new mysqli('localhost','NAME','PASSWORD','kano');
mysqli_set_charset($link, 'utf8');
if ($link->connect_error) {
die("连接失败: " . $conn->connect_error);
die("Failed to connect: " . $conn->connect_error);
}
$ranking = "kano_rank";//排行榜表名
$ranking = "kano_rank";

0 comments on commit 5d46485

Please sign in to comment.