Compare commits

...
2 Commits
Author SHA1 Message Date
earthjasonlin ef1ca1c48c fix error_reporting 2023-11-25 20:48:00 +08:00
earthjasonlin ba05834015 fix when id is empty 2023-11-25 20:47:24 +08:00
2 changed files with 3 additions and 1 deletions

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
<?php
error_reporting(0);
//设置json格式头部
header('Content-type: application/json');
//载入数据库文件
@@ -7,7 +8,7 @@ require("data.php");
if (isset($_GET['id'])) {
$id = $_GET['id'];
//查询指定id的记录
$sql = "SELECT * FROM soul WHERE id = $id";
$sql = "SELECT * FROM soul WHERE id = $id+0";
} else {
//查询随机一条记录
$sql = "SELECT * FROM soul ORDER BY RAND() LIMIT 1";
+1
View File
@@ -1,4 +1,5 @@
<?php
error_reporting(0);
ob_start();
session_start();
require("data.php");