discuz 如何添加数据DB::insert和更新数据DB::update 查询DB::qu_站长助手

时间:2023-08-06 13:11 浏览:0 评论:0
0
1.添加数据DB::insert
$uid=empty($_POST['uid']) ? "" : $_POST['uid'];
$username=empty($_POST['username']) ? "" : $_POST['username'];
$display_type=empty($_POST['display_type']) ? "" : $_POST['display_type'];
$filename=empty($_POST['filename']) ? "" : $_POST['filename']; 
$details=empty($_POST['details']) ? "" : $_POST['details'];
$videoname=empty($_POST['videoname']) ? "" : $_POST['videoname'];
//$sql="insert into pre_home_video(uid,display_type,filename,default) values('$uid','$display_type','$filename','$default')";
//$query = DB::query($sql);
if(!empty($_POST['uid']) && !empty($_POST['display_type']) && !empty($_POST['display_type'] ))
{
$count = DB::result(DB::query("select uid from pre_common_member where uid= $uid"), 0);
if($count)
{
$arr=array();
$arr['uid'] = $uid;
$arr['username'] = $username;
$arr['display_type'] = $display_type;
$arr['filename'] = $filename; 
$arr['details'] = $details;
$arr['videoname'] = $videoname;
if(!file_exists("data/video/{$uid}")){
mkdir("data/video/{$uid}", 0700);
}
if(!file_exists("data/video/{$uid}/cover")){
mkdir("data/video/{$uid}/cover", 0700);
}
$count1=DB::insert('home_video',$arr);
if($count1)
{
echo("[xss_clean]alert('添加成功');_window.location = \"admin.php?action=video\";[xss_clean]
1. 本站所有资源来源于用户上传或网络,仅作为参考研究使用,如有侵权请邮件联系站长!
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. discuz > discuz 如何添加数据DB::insert和更新数据DB::update 查询DB::qu_站长助手

用户评论