  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                ติดปัญหาเรื่องเวลาครับ 
 
พอดีเวลาหลัง ตี1 ไป มัน Error ครับ 
 
เช่น 
 
ตอนนี้ $Nowdate="2017-06-02"; พอเที่ยงคืน เปลี่ยนเป็นวันใหม่ 2017-06-03 
 
ซึ่งเงื่อนไขมันก็เลยผิด มันก็เลย ไม่เข้า Loop  
 
จะแก้ยังไงดีครับ 
 
Code (PHP) 
$Nowdate="Y-m-d";
$Nowdatetext=date("d/m/Y");
              $date_start1="$Nowdate 07:30";
              $date_end1=date("Y-m-d H:i",strtotime($date_start1."+12 hour"));
              $date_end1."<br>";
              $date_start2="$Nowdate 19:30";
              $date_end2=date("Y-m-d H:i",strtotime($date_start2."+12 hour"));
              $date_end2."<br>";
              if (time()>=strtotime($date_start1) AND time()<=strtotime($date_end1)) {
                $W="production_time >= '$date_start1' AND production_time < '$date_end1' ";
                $Showtext="ยังไม่ได้กรอกข้อมูลเที่ยว วันที่ $Nowdatetext 07:30-19:00 น.";
              }
              if (time()>=strtotime($date_start2) AND time()<=strtotime($date_end2)) {
                $W="production_time >= '$date_start2' AND production_time < '$date_end2' ";
                  $Showtext="ยังไม่ได้กรอกข้อมูลเที่ยว วันที่ $Nowdatetext 19:30-07:00 น.";
              }
            
                     $strSQLsum = "select production.production_time,production.production_date,sum(total40trip)as sum40trip,sum(total12trip)as sum12trip ,sum(total12trip1)as sum12trip1 ,sum(total16trip)as sum16trip,sum(total16trip1)as sum16trip1,sum(total25trip)as sum25trip,sum(total30trip)as sum30trip ,count(production_time )as numtrip,sum(toptrip)as sumtoptrip from production 
                where $W";
 
 
  Tag : PHP, MySQL, JavaScript, Ajax, Bootstrap Framework, XAMPP               
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2017-06-02 10:27:29 | 
                      By :
                          bondsanti | 
                      View :
                          868 | 
                      Reply :
                          1 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |