Compare commits
2 Commits
ba26402705
...
ef1ca1c48c
Author | SHA1 | Date | |
---|---|---|---|
ef1ca1c48c | |||
ba05834015 |
3
api.php
3
api.php
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
error_reporting(0);
|
||||||
//设置json格式头部
|
//设置json格式头部
|
||||||
header('Content-type: application/json');
|
header('Content-type: application/json');
|
||||||
//载入数据库文件
|
//载入数据库文件
|
||||||
@ -7,7 +8,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";
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
error_reporting(0);
|
||||||
ob_start();
|
ob_start();
|
||||||
session_start();
|
session_start();
|
||||||
require("data.php");
|
require("data.php");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user