123456789101112131415161718192021222324 |
- <?php
- header('Content-type:text/html;charset=utf-8');
-
- $link = mysqli_connect('localhost', 'shenzhenmayi', 'w82q5bmy', 'shenzhenmayi');
- if(!$link){
- exit('数据库连接失败!');
- }
-
- $n = 0;
- $arr = array();
-
- $sql = "SELECT * FROM ey_archives WHERE typeid = 1 LIMIT 6";
- $res = mysqli_query($link, $sql);
- while($row = mysqli_fetch_array($res)){
- $arr[0][$n] = $row['aid'];
- $arr[1][$n] = $row['title'];
- $n++;
- }
-
- echo json_encode($arr);
-
- mysqli_free_result($res);
- mysqli_close($link);
- ?>
|