摘要: // 取回数据表的第一条数据(一维数组 ) DB::table('table')->where('key', 'value')->first(); DB::table('table')->first(); // 从单行中取出单列数据 (非数组变量) DB::table('users')->where 阅读全文
posted @ 2020-12-29 17:38 『學無止境』 阅读(781) 评论(0) 推荐(0) 编辑
摘要: SQL 模糊查询 在进行数据库查询时,有完整查询和模糊查询之分。 一般模糊查询语句如下: SELECT 字段 FROM 表 WHERE 某字段 Like 条件 其中关于条件,SQL提供了四种匹配模式: 1,% :表示任意0个或多个字符。可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号 阅读全文
posted @ 2017-05-23 17:48 『學無止境』 阅读(316) 评论(0) 推荐(0) 编辑
摘要: $sql="select * from test4 "; $b = $pdo->query($sql); // 返回的是个新对象 $c =$b->fetchAll(); //遍历 //var_dump($c); echo ''; for ($i=1; $i <$b->rowCount(); $i++ 阅读全文
posted @ 2016-12-17 00:29 『學無止境』 阅读(130) 评论(0) 推荐(0) 编辑
摘要: mysql -hlocalhost -p3306 -uroot -p -- 进入cmd use php2016; -- 指定默认的操作数据库 set names gbk; -- 告诉服务器当前客户端的编码为gbk show databases; -- 查看当前有哪些数据库 show tables; 阅读全文
posted @ 2016-11-27 23:33 『學無止境』 阅读(150) 评论(0) 推荐(0) 编辑
摘要: $a = array( 'fruits' => array( 'a' => 'orange', 'b' => 'grape', 'c' => 'apple' ), 'numbers' => array(1, 2, 3, 4, 5, 6), 'holes' => array( 'first', 5 = 阅读全文
posted @ 2016-11-24 23:05 『學無止境』 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 今天第一在博客上写下自己学习的心路历程! 感觉还好, 后期加油! 阅读全文
posted @ 2016-10-22 22:48 『學無止境』 阅读(101) 评论(0) 推荐(0) 编辑