mysql多个字段(三个)查重记录
1、数据库设计
1、数据库设计
1 | SQL运算符 | 例子 | 实际查询条件 |
---|---|---|---|
eq | = | $map['id'] = array('eq',100); | 等效于:$map['id'] = 100; |
neq | != | $map['id'] = array('neq',100); | id != 100 |
gt | > | $map['id'] = array('gt',100); | id > 100 |
egt | >= | $map['id'] = array('egt',100); | id >= 100 |
lt | < | $map['id'] = array('lt',100); | id < 100 |
elt | <= | $map['id'] = array('elt',100); | id <= 100 |
like | like | $map['username'] = array('like','li%'); | username like 'li%' |
between | between and | $map['id'] = array('between','1,8'); | id BETWEEN 1 AND 8 |
not between | not between and | $map['id'] = array('not between','1,8'); | id NOT BETWEEN 1 AND 8 |
in | in | $map['id'] = array('in','1,5,8'); | id in(1,5,8) |
not in | not in | $map['id'] = array('not in','1,5,8'); | id not in(1,5,8) |
and(默认) | and | $map['id'] = array(array('gt',1),array('lt',10)); | (id > 1) AND (id < 10) |
or | or | $map['id'] = array(array('gt',3),array('lt',10), 'or'); | (id > 3) OR (id < 10) |
xor(异或) | xor | 两个输入中只有一个是true时,结果为true,否则为false,例子略。 | 1 xor 1 = 0 |
exp | 综合表达式 | $map['id'] = array('exp','in(1,3,8)'); | $map['id'] = array('in','1,3,8'); |
注意:exp 不是一个运算符,而是一个综合表达式以支持更复杂的条件设置。exp 的操作条件不会被当成字符串,可以使用任何 SQL 支持的语法,包括使用函数和字段名称。
如:
//当/www/index.php 都实际存在时
$file='index.php';
$dir='/www/';
if(file_exists($dir.$file)){
echo '文件'.$file.'存在';
}else{
echo '文件'.$file.'不存在';
}
if(is_dir($dir)){
echo '目录'.$dir.'存在';
}else{
echo '目录'.$dir.'不存在';
}
server {
listen 80;
server_name xx.com www.xx.com;
index index.html index.htm index.php;
#access_log /var/log/nginx/xx.a.log;
#error_log /var/log/nginx/xx.e.log;
location ~ .*\.php(\/.*)*$ {
root /apps/www/bolg;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
root /apps/www/bolg;
index index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
if ($request_uri = / ){
rewrite (.*) /index.php;
}
}
location = / {
rewrite (.*) /index.php;
}
}
du [-abcDhHklmsSx] -L <符号连接>--block-size --max-depth=<目录层数>--version
常用参数:
a或-all 为每个指定文件显示磁盘使用情况,或者为目录中每个文件显示各自磁盘使用情况。
-b或-bytes 显示目录或文件大小时,以byte为单位。
-c或–total 除了显示目录或文件的大小外,同时也显示所有目录或文件的总和。
-D或–dereference-args 显示指定符号连接的源文件大小。
-h或–human-readable 以K,M,G为单位,提高信息的可读性。
-H或–si 与-h参数相同,但是K,M,G是以1000为换算单位,而不是以1024为换算单位。
-k或–kilobytes 以1024 bytes为单位。
-l或–count-links 重复计算硬件连接的文件。
-L<符号连接>或–dereference<符号连接> 显示选项中所指定符号连接的源文件大小。
-m或–megabytes 以1MB为单位。
-s或–summarize 仅显示总计,即当前目录的大小。
-S或–separate-dirs 显示每个目录的大小时,并不含其子目录的大小。
-x或–one-file-xystem 以一开始处理时的文件系统为准,若遇上其它不同的文件系统目录则略过。
-X<文件>或–exclude-from=<文件> 在<文件>指定目录或文件。
–exclude=<目录或文件> 略过指定的目录或文件。
–max-depth=<目录层数> 超过指定层数的目录后,予以忽略。
–help 显示帮助。
–version 显示版本信息。
如果传过来的php数组已经json_encode过了
var js_arr = eval(<?php echo $php_arr;?>);
//thinkPHP 可以这么写
var js_arr = eval('{$php_arr}');
如果传过来的数组没有json_encode过
var js_arr = eval(<?php echo json_encode($php_arr);?>);
查看js数组js_arr长度
console.log(js_arr.length);
遍历js_arr数组
for(var i = 0 ; i < js_arr.length ; i++){
console.log(js_arr[i]);
}
<textarea id="demo" style="display: none;"></textarea>
<script>
layui.use('layedit', function(){
var layedit = layui.layedit;
uploadImage: {
//上传操作 后台Article控制器的layeditUpload方法
url: '{:U("Admin/Article/layeditUpload")}' //接口url
,type: '' //默认post
}
layedit.build('demo'); //建立编辑器
});
</script>
public function layeditUpload(){
$file = request()->file('file');
// 移动到框架应用根目录/public/uploads/ 目录下
$info = $file->move(ROOT_PATH . 'public' . DS . 'layeditUpload');
$reubfo = array(); //定义一个返回的数组
if($info){
$reubfo['code']= 0;
$reubfo['msg']= '上传成功';
$reubfo['data']['src']= "/layeditUpload/".$info->getSaveName();
}else{
// 上传失败获取错误信息
$reubfo['code']= -1;
$reubfo['err'] = $file->getError();
}
return json($reubfo);
}
标记语言,是一种将文本(Text)以及文本相关的其他信息结合起来,展现出关于文档结构和数据处理细节的电脑文字编码。与文本相关的其他信息(包括例如文本的结构和表示信息等)与原来的文本结合在一起,但是使用标记(markup)进行标识。
如:xml, html, xhtml等,都以 "ml"结尾。
脚本语言是为了缩短传统的编写-编译-链接-运行(edit-compile-link-run)过程而创建的计算机编程语言。它的命名起源于一个脚本“screenplay”,每次运行都会使对话框逐字重复。早期的脚本语言经常被称为批量处理语言或工作控制语言。
一个脚本通常是解释运行而非编译。脚本语言通常都有简单、易学、易用的特性,目的就是希望能让程序员快速完成程序的编写工作。
如:JavaScript、VBScript、PHP、Python,ruby等。
css设置背景图无重复,长宽百分之百
background: url(./img/bg.jpg) no-repeat;background-size: 100% 100%;