Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何从mysql数据库中选择当前日期和明天日期的数据_Php_Mysql - Fatal编程技术网

Php 如何从mysql数据库中选择当前日期和明天日期的数据

Php 如何从mysql数据库中选择当前日期和明天日期的数据,php,mysql,Php,Mysql,我有一个数据库,我只想从数据库中选择当前日期的数据,然后再选择明天的数据 $query = mysql_query("SELECT PatientMaster.PatientFirstName,PatientMaster.PatientLastName,PatientMaster.PatientID,ProviderAppointmentListings.ProviderNPI,ProviderAppointmentListings.AppointmentTime,ProviderAp

我有一个数据库,我只想从数据库中选择当前日期的数据,然后再选择明天的数据

$query = mysql_query("SELECT      PatientMaster.PatientFirstName,PatientMaster.PatientLastName,PatientMaster.PatientID,ProviderAppointmentListings.ProviderNPI,ProviderAppointmentListings.AppointmentTime,ProviderAppointmentListings.AppointmentListingsID, '' FROM PatientMaster JOIN ProviderAppointmentListings ON PatientMaster.PatientID = ProviderAppointmentListings.PatientId LIMIT 0, 30");



$rows = array();
while($row = mysql_fetch_assoc($query)) {
$rows[] = $row;
}
echo json_encode($rows);

从tablename中选择*WHERE TO_DAYS(columnname)介于TO_DAYS(NOW())和TO_DAYS(NOW())之间+1

这里根本不清楚您要问什么。请把问题说得更清楚些。你的意思是在当前日期和明天日期之间吗?在一个问题中,我想问当前日期,在另一个问题中,我想问明天日期
WHERE YOUR_DATE_FIELD=CURDATE() or YOUR_DATE_FIELD=CURDATE()+ INTERVAL 1 DAY