update api
This commit is contained in:
parent
90f506153f
commit
839f79eca2
11
api.php
11
api.php
@ -8,4 +8,13 @@ $sql = "SELECT * FROM soul ORDER BY RAND() LIMIT 1";
|
|||||||
$result = mysqli_query($conn, $sql);
|
$result = mysqli_query($conn, $sql);
|
||||||
$row = mysqli_fetch_assoc($result);
|
$row = mysqli_fetch_assoc($result);
|
||||||
//输出json
|
//输出json
|
||||||
echo json_encode(array('code' => 1, 'data' => $row['title']));
|
echo json_encode(array(
|
||||||
|
"code" => 0,
|
||||||
|
"message" => "OK",
|
||||||
|
"data" => array(
|
||||||
|
"id" => $row["id"],
|
||||||
|
"title" => $row["title"],
|
||||||
|
"author" => $row["author"],
|
||||||
|
"from" => $row["from"]
|
||||||
|
)
|
||||||
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user