php - SQL query not working for status="New" -


this code retrieving records according status given date range.

if( (!empty($_post['date1'])) && (!empty($_post['date2'])))         {             $query .="`createddate` between '$datefrom' , '$dateto' ";              if(!empty($_post['status']) && ($_post['status'] !="select one") )             {                 if($status=="new")                 {                            //echo "h1";                     $query .=" , status='new'";                                    }                                                        else if($status=="processing")                                                       {                     //echo "h2";                     $query .=" , status='$status'  ";                                                                                              }                                                        else if($status=="pending")                                                      {   //echo "h3";                                                         $query .=" , (crm_status='pending' or bss_status='pending' or oss_status='pending')";                                                      }                                                        else if($status=="completed")                                                        {   //echo "h4";                                                     $query .=" , (crm_status='completed' or bss_status='completed' or oss_status='completed')";                                                        }                                                        else if($status=="not available")                                                        {   //echo "h5";                                                         $query .=" , (crm_status='not available' or bss_status='not available' or oss_status='not available')";                                                     }                                                                            }         } 

but, when select date range , status="new", shows there no records. but, when entered same query in sql database, shows 3 records. knows reason this?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -