when i put the single quote ’ in the url like http://xxxxx/xxxxx/dor/Test.php?nomor=1234400’ the error message come out like like this
[b]Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\xampp\dor\Test.php on line 46
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\xampp\dor\Test.php on line 47[/b]
here the php code
[php]
Pengumuman Testing
PENGUMUMAN ONLINE
Kelulusan
SMA Negeri xxxx Jakarta
TAHUN AKADEMIK 2010/2011
<?php $username="root"; $password=""; $database="test1"; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $nomor = $_GET['nomor']; // inisialisasi nomor $query="SELECT * FROM murid WHERE Ujian = '$nomor'"; //sesuaikan nm_field "Ujian" dengan table murid di databaae... $result = mysql_query($query); $array = mysql_fetch_array($result); $rowResult = mysql_num_rows($result); $a = 'nomor yang anda masukan gagal'; ?> <?php if($rowResult==False): ?>
Maaf <?php echo "$a"; ?>
<?php else: ?>Selamat! Nomor Ujian <?php echo $array['ujian'];?> dengan Nama <?php echo $array['Nama']; ?> dinyatakan <?php echo $array['Status']; ?>
SMAN xxxxxx Jakarta Selatan
Nomor Telepon 73111444
Fax 2145225456532 [/php]
i’m new in php language please anybody help me