首页 文章 精选 留言 我的

精选列表

搜索[php扩展],共10000篇文章
优秀的个人博客,低调大师

PHP 数据库操作 db_medoo v2.1.2

更新功能: 1.对数据库表添加、修改、删除追加action。 2.添加对表结构的返回值 3.添加对FIND_IN_SET及RAW支持 数据库操作 对Medoo Version: 2.1.10再封装,让操作更简单。 composer require thefunpower/db_medoo $where条件 'user_name[REGEXP]' => '[a-z0-9]*' 'user_name[FIND_IN_SET]'=>(string)10 'user_name[RAW]' => '[a-z0-9]*' $where = [ //like查寻 'product_num[~]' => 379, //等于查寻 'product_num' => 3669, //大于查寻 'id[>]' => 1, 'id[>=]' => 1, 'id[<]' => 1, 'id[<=]' => 1, ]; $where = []; $where['OR'] = [ 'product_num[~]'=>379, 'product_num[>]'=>366, ]; $where['LIMIT'] = 10; $where['ORDER'] = ['id'=>'DESC']; where字段两个日期之间 字段是datetime类型 $date1 = '2022-11-01'; $date2 = '2022-12-14'; db_between_date($field,$date1,$date2) where 两个月份之间 $date1 = '2022-11'; $date2 = '2022-12'; db_between_month($field,$date1,$date2 查寻一条记录 $res = db_get_one("products","*",$where); $res = db_get_one("products",$where); 所有记录 $res = db_get("products","*",$where); $res = db_get("products",$where); 分页 $res = db_pager("products","*",$where); 使用原生方法 原生方法将不会触发action https://medoo.in/api/where $res = db()->select("products",['id'],[]); 查寻某个字段 $res = db_get("qr_rule","qr_num",['GROUP'=>'qr_num']); print_r($res); 写入记录 db_insert($table, $data = [],$don_run_action = false) 更新记录 db_update($table, $data = [], $where = [],$don_run_action = false) 取最小值 db_get_min($table, $join = "*", $column = null, $where = null) 其他一些如取最大值等 db_get_max db_get_count db_get_has db_get_rand db_get_sum db_get_avg 删除 db_del($table, $where) action 写入记录前 do_action("db_insert.$table.before", $data); do_action("db_save.$table.before", $data); 写入记录后 其中$data有id及data do_action("db_insert.$table.after", $action_data); do_action("db_save.$table.after", $action_data); 更新记录前 do_action("db_update.$table.before", $data); do_action("db_save.$table.before", $data); 更新记录后 其中$data有iddatawhere do_action("db_update.$table.after", $action_data); do_action("db_save.$table.after", $action_data); do_action("db_get_one.$table", $v); 删除前 do_action("db_insert.$table.del", $where); 显示所有表名 show_tables($table) 取表中字段 get_table_fields($table, $has_key = true) 返回数据库允许的数据,传入其他字段自动忽略 db_allow($table, $data) 显示数据库表结构,支持markdown格式 database_tables($name = null, $show_markdown = false) 数组排序 array_order_by($row,$order,SORT_DESC); 判断是json数据 is_json($data) SQL查寻 db_query($sql, $raw = null) do_action("db_query", $all) 其中$sql为select * from table_name where user_id=:user_id $raw为[':user_id'=>1] 事务 需要inner db支持 db_action(function()use($data)){ }); id锁 db_for_update($table,$id) 设置分页总记录数 db_pager_count($nums = null) 连表查寻 $data = db_pager("do_order", ["[><]do_mini_user" => ["uid" => "id"]], [ "do_order.id", "do_order.uid", "user" => [ "do_mini_user.nickName", "do_mini_user.avatarUrl", "do_mini_user.openid", ] ], $where); db_get复杂查寻 $lists = db_get('do_order', [ 'count' => 'COUNT(`id`)', 'total' => 'SUM(`total_fee`)', 'date' => "FROM_UNIXTIME(`inserttime`, '%Y-%m-%d')" ], 其他where条件请查看 https://medoo.in/api/where License TheMITLicense (MIT)

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册