foreach ($array as $key=>$val) {
$str .= '`'.$key.'`'.'='.'\''.$val.'\',';
}
$str = rtrim($str,',');
$sql = "update `{$table}` set $str wehre '{$where}'";
$str .= '`'.$key.'`'.'='.'\''.$val.'\',';
}
$str = rtrim($str,',');
$sql = "update `{$table}` set $str wehre '{$where}'";
2017-05-05
<td>
<input type="checkbox" id="c<?php echo $row['id'];?>" class="check">
<label for="c<?php echo $row['id'];?>" class="label"><?php echo $row['id'];?></label>
</td>
<input type="checkbox" id="c<?php echo $row['id'];?>" class="check">
<label for="c<?php echo $row['id'];?>" class="label"><?php echo $row['id'];?></label>
</td>
2017-05-02
// 管理员登录
function checkLogined() {
$_SESSION['adminId'] = empty($_SESSION['adminId'])? null : $_SESSION['adminId'];
$_COOKIE['adminId'] = empty($_COOKIE['adminId'])? null : $_COOKIE['adminId'];
if ($_SESSION['adminId'] =="" && $_COOKIE['adminId'] == "") {
alertMes("进入失败,请登录", "login.php");
}
}
function checkLogined() {
$_SESSION['adminId'] = empty($_SESSION['adminId'])? null : $_SESSION['adminId'];
$_COOKIE['adminId'] = empty($_COOKIE['adminId'])? null : $_COOKIE['adminId'];
if ($_SESSION['adminId'] =="" && $_COOKIE['adminId'] == "") {
alertMes("进入失败,请登录", "login.php");
}
}
2017-05-01
// 查询所有的分类,返回一个数组
function getAllCate() {
$sql = "select id,cName from imooc_cate order by id asc";
return fetchAll($sql);
}
function getAllCate() {
$sql = "select id,cName from imooc_cate order by id asc";
return fetchAll($sql);
}
2017-05-01