SHOW:
|
|
- or go back to the newest paste.
| 1 | include ("conn.php");
| |
| 2 | - | $sqlsavestok=mysqli_query($conn,"select * from budidaya"); |
| 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 | - | $sqlulang=mysqli_query($conn,"select * from logbarang where nmbarang='$inventori' and (tanggal between '$tgl2' and '2017-08-31') order by tanggal asc")or die (mysqli_error($conn)); |
| 8 | + | nmbarang like '$inventori' and |
| 9 | - | |
| 9 | + | date(tanggal) between '$tgl2' and '2017-08-31' |
| 10 | - | if(mysqli_num_rows($sqlulang)>0) |
| 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 | - | else |
| 17 | + | |
| 18 | echo $dataloop['tanggal']." ".$dataloop['nmbarang']." ".$dataloop['stok']."<br>"; | |
| 19 | - | echo "Errorx"; |
| 19 | + | |
| 20 | } | |
| 21 | ||
| 22 | } | |
| 23 | else | |
| 24 | {
| |
| 25 | echo "ERROR"; | |
| 26 | } |