fix when id is empty
This commit is contained in:
parent
ba26402705
commit
ba05834015
2
api.php
2
api.php
@ -7,7 +7,7 @@ require("data.php");
|
|||||||
if (isset($_GET['id'])) {
|
if (isset($_GET['id'])) {
|
||||||
$id = $_GET['id'];
|
$id = $_GET['id'];
|
||||||
//查询指定id的记录
|
//查询指定id的记录
|
||||||
$sql = "SELECT * FROM soul WHERE id = $id";
|
$sql = "SELECT * FROM soul WHERE id = $id+0";
|
||||||
} else {
|
} else {
|
||||||
//查询随机一条记录
|
//查询随机一条记录
|
||||||
$sql = "SELECT * FROM soul ORDER BY RAND() LIMIT 1";
|
$sql = "SELECT * FROM soul ORDER BY RAND() LIMIT 1";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user