1.插入語句
$sql=
"insert into Ad(AdClassID,AdType,AdTit,AdFileName,AdUrl,AShow,Addtime) values('"
.$AdClassID.
"','"
.$AdType.
"','"
.$AdTit.
"','"
.$AdFileName.
"','"
.$AdUrl.
"','1','"
.$Addtime.
"')"
;
|
2.從數據庫中選出數據
$sql =
"select * from AdClass order by ID desc"
;<br><br>$sql=
"select * from admin where AdminID='"
.$_SESSION['AdminID
']."'
";
|
$fids = str_replace("|",",",$_POST['fileid2']);//$_POST['fileid2'] == "2246|2247|2248" $sql2 = "select save_name from xxf_witkey_file where file_id in(".$fids.")"; $b = db_factory::query($sql2);//save_name二維集合數組
3,批量刪除
// 1,根據checkbox過來的一維數組, 轉成字符串;2、因為是order_id,所有在in 里面使用整型 is_array ( $ckb ) and $ids = implode ( ',', $ckb ); $order_status = 'close'; $res = db_factory::execute("delete from xxf_witkey_home_order where order_id in (".$ids.") and order_status = '".$order_status."'");
4.更新數據庫中記錄數據
$sql=
"update Ad set AdClassID='"
.$AdClassID.
"',AdType='"
.$AdType.
"',AdTit='"
.$AdTit.
"',AdFileName='"
.$AdFileName.
"',AdUrl='"
.$AdUrl.
"',Addtime='"
.$Addtime.
"' where ID="
.$ID.
""
;
|
$SQl = "update xxf_witkey_activity set subhead='".$subhead."' where a_id=".$a_id."";
5、進行模糊like查詢:
$sql = "select * from xxf_witkey_article where cat_type ='article' and is_recommend =1 and art_title like '%".$key_word."%' order by art_id desc ";