mySql 操作语句

关键词模糊搜索

$keyWord = $queryArr['keyWord'];
$sql = "select * from $table where is_delete=0 and title  like '%" .$keyWord."%'" ;

日期区间查询

$startDate = $queryArr['startDate'];
$endDate = $queryArr['endDate'];
$sql = "select * from $table where is_delete=0 and DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN '".$startDate."' and '".$endDate."'";

你可能感兴趣的:(mySql 操作语句)