更新和条件-php快速入门系列教程
更新和条件主讲人: 幻令博客:https://blog.icodef.com论坛:https://www.eruyi.cn目录:https://www.eruyi.cn/thread-1412-1-1.htmlupdateupdate开头,set后为设置的数据,不同的列使用','分开
举个栗子
update `table` set `field1`='value',`field2`='value2' where `id`=1;
wherewhere后面接的是条件,如果是update的话,后面接的意思就是修改那些行的内容,还有delete(删除),select(查询)的时候也会用到where语句
常用操作符
常用的有下面这些=(相等),<>/!=(不等于),>(大于),<(小于),>=(大于等于),<=(小于等于)
like模糊查询的时候会用到like
where `field` like '%模糊';/** 百分号在前表示搜索结尾为'模糊'的行 **//** 在后则表示搜索开头为'模糊'的行,两边都打上就是内容包括'模糊'的行 **/
in/not in值是否是in中的其中一个,not in 相反
where `id` in (1,2,3);where `id` not in (1,2,3);
多条件多个条件就使用 and(且),or(或) 来连接,和我们写php中的&& || 一样
where `field`='value' and `field2`='value2';where `field`='value' or (`field2`='value2' and `id` in (1,2,3));
**** Hidden Message *****
谢谢分享 66666666666 更新和条件-php快速入门系列教程 www.eruyi.cn 很好很强大 rrrrrrrrrrrrrrrrrrrrrrrr 6666666666666666666666666666666 详细信息学习学习嘻嘻嘻 66666666666666666666666666666
页:
[1]
2