1、PHP连接数据库
a:连接
$con=mysqli_connect('地址','账号','密码','数据库');
b:编码格式
mysqli_query($con,'set names utf8');
c: sql
d:发送sql语句
mysqli_query($con,$sql);
e:关闭数据 mysqli_close($con);
2、sql语句
1.查询: "select [信息] from 表名 where 条件"
2.插入: "insert into 表名(id,...) values(id,....)"
3.修改: "update 表名 set 新值 where 旧值";
4.删除: "delete from 表名 where id=1";
"delete from 表名"删除全部
3、格式
php数组 转json字符串格式 json_encode(数组)
js:字符串--json格式:JSON.parse()