最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
mysql int保存数据技巧
时间:2022-06-24 19:04:27 编辑:袖梨 来源:一聚教程网
public function insert($data)
{
if(isset($data['content'])&&!empty($data['content']))
{
$data_for_query['content'] = trim($data['content']);
}
else
{
return false;
}
if(isset($data['user_id'])&&!empty($data['user_id']))
{
$data_for_query['user_id'] = intval($data['user_id']);
}
else
{
return false;
}
$sql = "insert into `".$this->table_name."` (".$this->db->implodetocolumn(array_keys($data_for_query)).") values (".$this->db->implodetovalues(array_values($data_for_query)).")";
$this->db->query($sql);
$id = $this->db->lastinsertid();
if(empty($id))
{
return false;
}
else
{
return $id;
}
}
相关文章
- 原神千星奇域进入位置 10-14
- 蜘蛛纸牌网页版入口 无需下载注册点击秒玩 10-14
- 纸房子游戏安装入口 steam正版纸房子购买链接 10-14
- 原神云游戏官网入口 云原神网页版在线地址 10-14
- 我的花园世界最新兑换码分享 我的花园世界白嫖VIP方法介绍 10-14
- 荒野大镖客2作弊码有哪些 全作弊代码大全一览 10-14