diff --git a/api.php b/api.php index f9479db..b7ac6a1 100644 --- a/api.php +++ b/api.php @@ -4,7 +4,7 @@ //载入数据库文件 require("data.php"); $sql="select * from soul order by rand( ) limit 1"; - $row=mysql_fetch_assoc(mysql_query($sql)); + $row=mysqli_fetch_assoc(mysql_query($conn,$sql)); //输出json echo json_encode(array('code'=>1,'data'=>$row['title'])); ?> diff --git a/data.php b/data.php index f2c0765..1c8d655 100644 --- a/data.php +++ b/data.php @@ -1,5 +1,5 @@ diff --git a/index.php b/index.php index d83970e..79c6a29 100644 --- a/index.php +++ b/index.php @@ -44,11 +44,11 @@ @@ -78,4 +78,4 @@ - \ No newline at end of file +