当前位置:网站首页>TP & smart use diary
TP & smart use diary
2022-07-23 17:49:00 【Ideal coder】
stay smarty Make the timestamp mature / month / Day format :
{$v.goods_create_time|date_format:"%Y-%m-%d %H:%M:%S"}
stay tp Get constants that can be used provided by the system :
get_defined_constants(true);
Database operation :
creat() Method
//add() Method to add records using the array method
$user = new M('user');
$arr = array(
'field1' => 'v1',
'field2' => 'v2',
'field3' => 'v3',
);
$user->add($arr);
create() Method
if(isset($_POST)){
$user = new M('user');
$user->create();
$user->add();
}
save() Method
$user = new M('user');
$arr = array(
'field1' => 'v1',
'field2' => 'v2',
'field3' => 'v3',
);
$user->save($arr);
// No conditions set , Talk about modifying all records in the database ,tp The framework should not allow this
// You can set where() Conditions
// Such as :
//$user->where("goods_price>1000")->save($arr);
边栏推荐
- Geometric parametric reconstruction
- Thread pool, who am I? Where am I?
- computed在项目中的使用
- Mysql操作
- Visual computer room management
- Single cell thesis record (part19) -- a comprehensive comparison on cell type composition information for St data
- Rust中的函数function与方法method的区别
- 面试官:如何用 Redis 实现分布式锁?
- MySQL7种JOIN(图)
- Aike AI frontier promotion (7.23)
猜你喜欢

分析optimism重放合约地址攻击事件

USB Type-C PD CC逻辑芯片中的角色定义

Solutions to sap Hana database backup failure

SAP HANA数据库备份失败解决办法

el-input使用

ride the wind and waves! Digital transformation in the era of financial technology

Food safety chocolate is also true or false? How much do you know about it

New opportunities for cultural tourism in the era of digital intelligence? China Mobile Migu creates "the first island in the yuan universe"

leetcode刷题:动态规划04(不同路径)

Kubernetes focuses on kubelet's responsibilities
随机推荐
Solution to connection rejected error in idea download sources
Analyze optimism replay contract address attack events
MySQL field modification
为啥一问 JVM 就 懵B ???
LeetCode_724_寻找数组的中心下标
ride the wind and waves! Digital transformation in the era of financial technology
Rust中的函数function与方法method的区别
TwinCAT 3 首次运行报错4115
Log slimming operation: from 5g to 1g!
Repository XXX does not have a rease file "suggested collection"
训练和测试的loss不下降,并且精度超低
MySQL大量写入问题优化方案 MySQL参数调优
computed在项目中的使用
Food safety | eight things you must know when choosing probiotic products
Record the range of data that MySQL update will lock
File management system based on OpenPGP
rust统计文件中单词出现的次数
深入理解机械系统的模态与振动
sns_ sensor_ instance_ api
你真的了解Redis的持久化机制吗?