Script cari ga tampil...

_FB_NAME_ · Sep 14, 2012
Assalamualaikum wr wb... Gan, k script cari data ane ga tampil yah????
Mohon bantuan gan...
<?php 
session_start();

if (session_is_registered('id_admin'))
{
	?>

	<div class="post">
	<div class="entry">
		<form action="?<?php echo paramEncrypt('page=./laporan/buku_jurnal')?>" method="post" name="postform">
		  <table width="531" border="0">
			<tr>
			  <td width="48"><strong>Masukan Nama Sales</strong></td>
			  <td colspan="2"><input type="text" name="sales" size="15" value=""/>
			 
			  <td width="77"><input type="submit" name="report" value="Tampilkan" /></td>
			</tr>
		  </table>
		</form>
	</div>
	</div>


	<div class="post">
		<div class="entry">
			<p>
			<?php
			//untuk menyelesaikan transaksi
			if(isset($_POST['report'])){
				
				//tanggal periode laporan
				$sales=$_POST['sales'];
				
				
				$query_transaksi=mysql_query("select * from data where sales=$sales order by notel asc");
				
	
			}else{
			
				$query_transaksi=mysql_query("select * from data order by notel asc");
				
			
				unset($_POST['report']);
			}
			?>
			
						
			<h2 align="center"><strong>Laporan Data Penjualan Sales : </strong></h2>
			<p align="center">&nbsp;</p>
			<table class="datatable" border="1">
			<tr>
				<th>Notel</th><th>Nama</th><th>Alamat</th><th>Sales</th><th>Paket</th>
			</tr>
			<?php
			
			while($row_tran=mysql_fetch_array($query_transaksi)){
								
				?>
				<tr>
					<td><div align="center"><?php echo $row_tran['notel'];?></div></td>
					<td><div align="center"><?php echo $row_tran['nama'];?></div></td>
					<td><?php echo $row_tran['alamat'];?></td>
					<td><?php echo $row_tran['sales'];?></td>
					<td><?php echo $row_tran['paket'];?></td>
					
				</tr>
				<?php
			}
			?>
			</table>

			
			</p>
		</div>
	</div>
	
	
	
<?php 
}else{
	echo "Forbidden Access!";
}
?>

Pesan errornya gini :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a5632292/public_html/web2/laporan/buku_jurnal.php on line 56
Silahkan login untuk menjawab!
0
Loading...
Ressa Cahyani · Sep 14, 2012 · 0 Suka · 0 Tidak Suka
berarti ada kesalahan pada query $query_transaksi
coba ganti sales=$sales menjadi sales='$sales'