Minggu, 22 September 2013

PHP Indonesia - Facebook: Nama :

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/ 
Nama :<...
Sep 22nd 2013, 11:41, by Fakhrunnisa Fauziah Lbl

Fakhrunnisa Fauziah Lbl 11:41am Sep 22
<tr>
<td><strong>Nama</strong></td>
<td>:</td>
<td><?php echo $x['nama']; ?></td>
</tr>
A PHP Error was encountered

Severity: Notice

Message: Undefined index: nama

Filename: views/kartu.php

Line Number: 13 (yg 'nama')
harusnya gimana? dilangsungin $nama kah?

Muh Arifin 11:42am Sep 22
array result() nya mana?

Fakhrunnisa Fauziah Lbl 11:44am Sep 22
contohin :v

Kokoh 11:44am Sep 22
code nya yg lengkap kakak. segitu ndak kelihatan masalahnya

Arif Rahman 11:45am Sep 22
msalah'a tu apa??
coding'a sis...

Muh Arifin 11:45am Sep 22
post aja kode yang lengkap

Arif Rahman 11:45am Sep 22
kurang lengkap

Muh Arifin 11:45am Sep 22
<?php foreach($data->result() as $key=>$t): ?>

<?php for($x=1;$x<=31;$x++){ ?>
<?php $c="cuti".$x; ?>
<?php $s="sakit".$x; ?>
<?php $iz="izin".$x; ?>

<td class=" <?php if( $t->$c != 0){ echo "cuti";} ?> <?php if( $sakit[$key]->$s != 0){ echo "sakit";} ?> <?php if( $izin[$key]->$iz != 0){ echo "izin";} ?> "> &nbsp;</td>
<?php } ?>

<?php endforeach ?> CONTOH

Fakhrunnisa Fauziah Lbl 11:46am Sep 22
<body>
<table width="305" height="268" border="1,5" align="center" bgcolor="#666666">
<tr>
<td width="317"><table width="297" height="102" border="0">
<tr>
<td width="114"><strong>Kode Anggota</strong> </td>
<td width="10">:</td>
<td width="159"><?php echo $kode_anggota ?></td>
</tr>
<tr>
<td><strong>Nama</strong></td>
<td>:</td>
<td><?php echo $x['nama']; ?></td>
</tr>
<tr>
<td><strong>Alamat</strong></td>
<td>:</td>
<td><?php echo $x['alamat']; ?></td>
</tr>
<tr>
<td><strong>Telephone</strong></td>
<td>:</td>
<td><?php echo $x['tlp'];?></td>
</tr>
</table>
<table width="297" height="51" border="0">
<tr>
<td width="291" align="center"><img src="<?php echo base_url() ?>fotos/<?php echo $x['foto'] ?>" width="117" height="100" border="1"/></td>
</tr>
</table>
<table width="297" height="52" border="0">
<tr>
<td width="114"><strong>Aktif</strong></td>
<td width="11">:</td>
<td width="158"><?php echo $tanggal;?></td>
</tr>
<tr>
<td><strong>Berlaku </strong></td>
<td>:</td>
<td><?php echo $tanggal_akhir;?></td>
</tr>
</table>
</td>
</tr>
</table>

</body>
<p align="center"><a href="#" onclick=print();>Print</a>
setiap echonya eror....

Muh Arifin 11:47am Sep 22
$x[] datang dari mana?

Arif Rahman 11:48am Sep 22
query'a mn mbak??

Kokoh 11:50am Sep 22
include file nya mungkin........

Wawan Indrawan Madda 11:50am Sep 22
coba var_dump($x); liat apa yang terjadi

Fakhrunnisa Fauziah Lbl 11:53am Sep 22
hasil query diatas

Yanuar Arifianto 11:56am Sep 22
Variable x belum dideklarasikan tuh. kode_anggota juga.
Harusnya ada 1 script PHP di atas tabel itu.

Fakhrunnisa Fauziah Lbl 11:57am Sep 22
harusnya apa? maaf baru bljr

Kokoh 11:58am Sep 22
scrip buat query database nya kakak

Kokoh 12:00pm Sep 22
sik bentar... apakah kakak pake framework?? CI???

Puzha Fauzha 12:00pm Sep 22
syntax query nya mana yah mbak ?
yang gitu masalahnya di query mbak .
contoh :
$sql = "SELECT * FROM artikel";
$hsl = mysql_query($sql);
while ($hasil = mysql_fetch_array($hsl)) {
// nah di sini baru masukin syntax yang tadi mbak post .
// contoh :
$nama = $hasil['nama'];
}

Fakhrunnisa Fauziah Lbl 12:00pm Sep 22
gini bukan?
<tr>
<td>NIS</td>
<td><input name="nis" type="text" id="nis" value="<?php echo set_value('nis');?>"></td>
</tr>

aduh ga ngerti :(

Fakhrunnisa Fauziah Lbl 12:01pm Sep 22
oh querynya disimpen sebelum yg itu gitu?

Puzha Fauzha 12:02pm Sep 22
iyah .
coba liat di sini deh .
https://planetprogramming.wordpress.com/2013/07/23/menampilkan-data-dari-database-dengan-php/

Fakhrunnisa Fauziah Lbl 12:03pm Sep 22
iya pake CI.
oke diliat dulu

Kokoh 12:03pm Sep 22
owalah. ndak bilang dari tadi... masalah di modelnya... coba copas controler c_pendaftaran function buat_kartu

Fakhrunnisa Fauziah Lbl 12:11pm Sep 22
gini?
<tr>
<td><strong>Nama</strong></td>
<td>:</td>
<td><?php $sql = "SELECT * FROM kartu";
$hsl = mysql_query($sql);
while ($hasil = mysql_fetch_array($hsl))
{$nama=$hasil ['nama'];} ?></td>
</tr>
tapi malah eror di {$nama=$hasil ['nama'];} ?></td>

Yanuar Arifianto 12:12pm Sep 22
while ($hasil = mysql_fetch_array($hsl));
$nama=$hasil ['nama']; ?>

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