06 2020 档案

摘要:<?php //这是父类 // class father{ // public $i='人';//共有的在哪里都可以访问,不写就默认是这个 // // protected $i = '人';//这个是受保护的只能在自己类和子类中访问 // // private $i = '人';//这个是私有的只能 阅读全文
posted @ 2020-06-17 16:58 不吃肉的羊 阅读(216) 评论(0) 推荐(0)
摘要:<?php // namespace a { // const a='定义常量'; //这是在命名空间里定义常量 // function a(){ // echo 'a<br>'; // } // } // namespace b { // function b(){ // // echo 'b'; 阅读全文
posted @ 2020-06-16 17:00 不吃肉的羊 阅读(425) 评论(0) 推荐(0)
摘要:1.实现分页 下面的内容是写在列表页面的 <?php // 分页 $key = isset($_GET['key'])?$_GET['key']:'';//这是查询 key是从form表单传上来的 然后判断text里面的值用来做模糊查询 // var_dump($key); $page = isse 阅读全文
posted @ 2020-06-09 16:54 不吃肉的羊 阅读(176) 评论(0) 推荐(0)
摘要:添加产品layui图片上传 1.表单页面 这是把内容上传到数据库 <?php if($_POST){ $title = $_POST['title']; $intro = $_POST['desc']; $content = $_POST['content']; $uname = $_POST['i 阅读全文
posted @ 2020-06-08 17:03 不吃肉的羊 阅读(362) 评论(0) 推荐(0)
摘要:<?php 登陆页面 if($_POST){ // 接受提交过来的数据 $uname = trim($_POST['uname']); $pasd = md5($_POST['pasd']); // 查询数据库 $conn = new mysqli('localhost','root','root' 阅读全文
posted @ 2020-06-06 16:50 不吃肉的羊 阅读(249) 评论(0) 推荐(0)
摘要:<?php// 链接数据库//赋值给变量 实例化类 ip地址 用户名 密码 数据库名称$conn = new mysqli('localhost','root','root','edu'); //判断链接是否成功//if($conn->connect_error){ //die的意思是输出这句后 后 阅读全文
posted @ 2020-06-05 17:00 不吃肉的羊 阅读(255) 评论(0) 推荐(0)
摘要:1.模糊查询 select * from 表名 where 字段 like ‘%w%’; select * from grade where name like '%java%'; %号中间写查询数据的内容 这个用的比较多 select * from grade where name like 'j 阅读全文
posted @ 2020-06-01 16:29 不吃肉的羊 阅读(298) 评论(0) 推荐(0)