嘿伙计们,我正在尝试从 mysql 中选择一个日期,格式是 date("F j, Y"); 但我只是选择日期的年份,我的字段是 varchar 类型,这是我的 php:
session_start();
$school_id = $_SESSION['school_id'];
$section_id = $_POST['section_id'];
$today = date("F j, Y");
$select_grades_deped = "SELECT *
FROM deped_grade_archive
WHERE school_id='$school_id'
AND section_id='$section_id'
AND submission_date ='$today' ";
$query_check_grades= mysql_query($select_grades_deped) or die (mysql_error());
$check_count = mysql_num_rows($query_check_grades);
if($check_count == 0){
$return['checked'] = "0";
}
else{
$return['checked'] = "1";
}
echo json_encode($return);
它返回 0,有没有办法只从 mysql 中选择一年?我在选择日期方面是菜鸟,所以请帮忙,我知道 mysql 已被弃用,并且在这个项目之后将切换到 mysqli,所以请帮助大家。tnx 提前 https://stackoverflow.com/posts/19491573/edit