Advertisement
kura2yamato

perbaikan query (2)

Sep 21st, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         include ("conn.php");
  2.         $sqlsavestok=mysqli_query($conn,"select count(*) as total from budidaya");
  3.         if($sqlsavestok)
  4.         {
  5.             echo "OK";
  6.             $tgl2 = date('Y-m-d', strtotime('+1 days', strtotime($tanggalmasuk)));
  7. $query="select * from logbarang where
  8. nmbarang like '$inventori' and
  9. date(tanggal) between '$tgl2' and '2017-08-31'  
  10. order by tanggal asc";
  11.  
  12.             $sqlulang=mysqli_query($conn,$query)or die (mysqli_error($conn));
  13. /* bila error di atas.. tidak akan lanjut */           
  14. echo "<hr>query<br/>$query<hr> ";
  15.             {
  16.                 while($dataloop=mysqli_fetch_array($sqlulang))
  17.                 {
  18.                     echo $dataloop['tanggal']." ".$dataloop['nmbarang']." ".$dataloop['stok']."<br>";
  19.                 }  
  20.             }
  21.  
  22.         }
  23.         else
  24.         {
  25.             echo "ERROR";
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement