• tp5增删改查基本操作


            //插入数据
            $res = Db::execute('insert into phptab(info) values("小张")');
            dump($res);
            //修改数据
            $res = Db::execute('update phptab set info="你好tp" where id=1');
            //删除数据
            $res = Db::execute('delete from phptab where id=1');
            //查询数据
            $res = Db::query('select * from phptab');
            dump($res);
            // // 防注入操作
            $res = Db::execute('insert into phptab(info) values(:info)', ['info' => '你好tp']);
            $res = Db::execute('insert into phptab(info) values(?)', ["不太好"]);
            // PDO插入
            $res = Db::table('phptab')->insert(['info' => '哈哈哈']);
            // 更新
            $res = Db::table('phptab')->where('id', 2)->update(['info' => '迪迦']);
            $res = Db::table('phptab')->select();
            $res = Db::table('phptab')->where('id', 5)->delete();
            $db = Db::table('phptab');
            $res = $db->insert(['info' => '哈哈哈']);
            $res = Db::name('phptab')->insert(['info' => '哈哈哈']);
            //统计数量count
            $res = $db->count('info');
            dump($res);
            return 1;
  • 相关阅读:
    PAT 1032 (未完成)
    PAT 1031
    PAT 1030
    将爬取到的数据存入数据框并导出
    XPath常见用法
    python 图表
    Protobuf在Unity中的通讯使用
    ProtoBuf在Unity中的使用
    Unity更新资源代码
    匿名函数
  • 原文地址:https://www.cnblogs.com/xiaozhang666/p/11465310.html
Copyright © 2020-2023  润新知