ajax第七天

一个小作业

2018-11-05_080244.png

.sql文件

SET NAMES UTF8;
DROP DATABASE IF EXISTS meishichina;
CREATE DATABASE meishichina CHARSET=UTF8;
USE meishichina;
CREATE TABLE dish(
  did INT PRIMARY KEY AUTO_INCREMENT,
  dname VARCHAR(16),
  pic VARCHAR(16),
  author VARCHAR(8),
  pubTime DATE
);
INSERT INTO dish VALUES(NULL,'麻辣香锅','img/1.jpg','王国魁','2018-11-5');
INSERT INTO dish VALUES(NULL,'夫妻肺片','img/2.jpg','张世远','2018-11-5');
INSERT INTO dish VALUES(NULL,'脆皮鸡盖饭','img/3.jpg','脆皮鸡','2018-11-5');
SELECT * FROM dish;

执行添加语句的php

执行添加语句的html

dname:

pic:

author:

pubTime:

执行删除语句的php

返回查看";
}else{
    echo '删除失败';
}

div显示所有列表的php

   ";
         while(true){
            //抓取一行数据
            $row=mysqli_fetch_assoc($result);
            // var_dump($row);
            if($row===null){
                break;
            }else{
                echo "
"; echo "
    "; echo "
  • $row[did]
  • "; echo "
  • X
  • "; echo "
"; echo "
    "; echo "
  • "; echo "
  • $row[dname]
  • "; echo "
"; echo "

$row[author]$row[pubTime]

"; echo "
"; } } echo "
"; } ?>

你可能感兴趣的:(ajax第七天)