For more information about php Data processing, see "php" and "mysql" for a patient appointment statistics function. by default, all visiting data is displayed when the page is loaded, you can also enter the period of the visit date for search: how to implement this function now, the following code is what I implement now, may be written incorrectly, please help implement this function. Mysql data table structure CREATETABLE 'Yu master please, ask a question about php Data processing
Use php and mysql to implement a patient appointment statistics function:
By default, the page is loaded to display all the data sent to the clinic. you can also enter the period of the visit date to search:
How to implement this function now? the following code is part of my current implementation, which may be incorrectly written. please help me implement this function.
Create table 'yuyuue '(
'Id' int (11) not null auto_increment, 'id automatic number
'Fangshi 'varchar (250) default NULL, 'reservation method: divided into network and telephone
'Yydate' varchar (250) default NULL, 'reservation date
'Djdate' varchar (250) default NULL, 'registration date
'Dzhen' int (11) default '0', 'whether to visit: 0 return, 1 is
'Dzdate' varchar (250) default NULL, 'to date of diagnosis
Primary key ('id ')
) ENGINE = MyISAM AUTO_INCREMENT = 2333 default charset = utf8;
Function. inc. php
PHP code
= '$date1' and `dzdate` <= '$date2' "; } if( !empty($date1) && empty($date2) ){ $sql = $sql." and `dzdate` = '$date1'"; } if( empty($date1) && !empty($date2) ){ $sql = $sql." and `dzdate` <= '$date2'"; } return $sql; }
PHP code