mysql - PHP MySQLi getting invoice due and working out if its late -
i have function have done gets invoice_due_date, in either format: 12/06/2015 or 06/12/2015 new , little lost on how can want do.
i need date (either format) dd/mm/yyyy or mm/dd/yyyy , compare date todays date , if late show how many invoices late.
i guess need date, check date format , see if later todays today , output number of how many invoices late.
php far:
function countlateinvoices() { // connect database $mysqli = new mysqli(database_host, database_user, database_pass, database_name); // output connection error if ($mysqli->connect_error) { die('error : ('.$mysqli->connect_errno .') '. $mysqli->connect_error); } $query = "select invoice_due_date `invoices`"; // mysqli select query $results = $mysqli->query($query); /* determine number of rows result set */ $row_cnt = $results->num_rows; echo $row_cnt; // frees memory associated result $results->free(); // close connection $mysqli->close(); }
Comments
Post a Comment