我正在尝试从数据库中获取行数,可能是:
$query = mysqli_query($con, "SELECT * FROM table WHERE '2015-03-01' IS BETWEEN column_1 and column_2 ");
if (mysqli_num_rows($query) < 1) {
echo "nothing found !";
} else {
echo "numrow found !";
}
答案 0 :(得分:0)
介于两者之间是错误的语法:
BETWEEN运算符选择范围内的值。值可以是数字,文本或日期。
$query = mysqli_query($con, "SELECT * FROM table WHERE '2015-03-01' BETWEEN column_1 and column_2");
if (mysqli_num_rows($query) < 1) {
echo "nothing found !";
}else{
echo "numrow found !";
}