Rabu, 14 Agustus 2013

PHP Indonesia - Facebook: maaf ya saya baru maw blajar php, mohon bantuannya...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
maaf ya saya baru maw blajar php, mohon bantuannya...
Aug 14th 2013, 13:15, by Jaenal Acces

Jaenal Acces 1:15pm Aug 14
maaf ya saya baru maw blajar php, mohon bantuannya!

mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pegawai\tampil.php on line 21,apa y saya gk ngerti

Alfan Zain 1:15pm Aug 14
codenya dung.
biasanya itu yang di "mysql_fetch-array()" kan error

Abah Sidi 1:18pm Aug 14
cek sqlnya dan benerin yg salah.

Gunawan Mujur Wibisono 1:19pm Aug 14
no script.. hoax ... dibantu kasi script.. taro di http://pastebin.com ingat... jgn copas disini

Alfan Zain 1:20pm Aug 14
^
serem, bawa ashura

Abah Sidi 1:25pm Aug 14
copas querynya aja jgn kode PHP.

Muhammad Erfan 1:35pm Aug 14
saya pernah ketemu masalah gitu, ternyata yang salah adalah bagian koneksinya, waktu itu saya salah ketik nama database...

Gunawan Mujur Wibisono 1:36pm Aug 14
cepat copas sebelum lupa codenya

Abah Sidi 1:39pm Aug 14
^ hahhahah..sabar, om

Jaenal Acces 1:43pm Aug 14
<?php
include "koneksi.php";
?>
<div id="content">
<h2>data pegawai</h2>
<table id="tabel">
<tr>
<th width="5%">No</td>
<th width="10%">NIP</td>
<th width="20%">Nama</td>
<th width="15%">Tgl Lahir</td>
<th width="20%">Jenis Kelamin</td>
<th width="30%">Alamat</td>
<th>Action</td>
</tr>
<?
$no = 1;
$query = "SELECT nip, nama, tgllahir, jk, alamat
FROM pegawai ORDER BY nip";
$sql = mysql_query ($query);
while ($hasil = mysql_fetch_array ($sql)) {
$nip = $hasil['nip'];
$nama = stripslashes ($hasil['nama']);
$jenkel = ($hasil['jk']==0)?"Laki-laki" : "Wanita";
$tgllhr = stripslashes ($hasil['taggallahir']);
$alamat = stripslashes ($hasil['alamat']);
$warna = ($no%2==1)?"#ffffff":"#efefef";
//
//tampilkan data pegawai
?>
<tr bgcolor="<?=$warna?>">
<td><?=$no?></td>
<td><?=$nip?></td>
<td><?=$nama?></td>
<td><?=$tanggallahir?></td>
<td><?=$jk?></td>
<td><?=$alamat?></td>
<td>
<a href="index.php?page=foto&nip=<?=$nip?>">Foto</a><br/>
<a href="index.php?page=edit&nip=<?=$nip?>">Edit</a><br/>
<a href="index.php?page=delete&nip=<?=$nip?>">Delete</a></td>
</tr>
<? $no++; }?>
</table>
</div>

Ar Land 1:44pm Aug 14
on line 21 itu sudah menunjukan letak kesalahannya .. di periksa bagian itu hehehe

Muhammad Erfan 1:46pm Aug 14
$tgllhr = stripslashes ($hasil['taggallahir']); ganti jadi $tgllhr = stripslashes ($hasil['tgllahir']);

Muhammad Erfan 1:48pm Aug 14
isi file koneksi.php apa sudah bener gan?? nama databasenya??

Jaenal Acces 1:48pm Aug 14
kan di ddi databasenya tanggallahir gmana donk,

Muhammad Erfan 1:49pm Aug 14
kalo gitu yang salah baris perintah SQLnya, kan disitu tertulis tgllahir :-D

Abah Sidi 1:50pm Aug 14
cek query ini: SELECT nip, nama, tgllahir, jk, alamat FROM pegawai ORDER BY nip

tanggallahir ato tgllahir?

Gunawan Mujur Wibisono 1:50pm Aug 14
$sql = mysql_query ($query)or die(mysql_error());

Muhammad Erfan 1:51pm Aug 14
itu tuh yang ditulis Abah Sidi :-D

Jaenal Acces 1:56pm Aug 14
v saya udah inport,dan di ubah sesuai karakter penulisan saya

Jaenal Acces 1:58pm Aug 14
makanya saya minta di ajarin cos,saya suka dengan tampilan php,di banding program desktop, visual basic

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar