Sabtu, 12 Oktober 2013

PHP Indonesia - Facebook: [ASK].. Om2 knp script ini error ya ?? $tampil="...

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/ 
Manage your social media

Best social media tool for image publishing to Facebook and Twitter. Look amazing and delight your followers. Get 40% off when you sign up today.
From our sponsors
[ASK].. Om2 knp script ini error ya ?? $tampil="...
Oct 13th 2013, 03:51, by Trio Ferdiansyah

Trio Ferdiansyah 3:51am Oct 13
[ASK]..

Om2 knp script ini error ya ??

$tampil="select*from anggota where no_id='$_GET[no_id]'";

note : saya udah cari contoh lain di google..scriptnya sama dengan diatas,,,

Trio Ferdiansyah 3:52am Oct 13
script lengkapnya : <html>
<body>
<form action="simpanedit.php" method="post">
<table align="center" border='1' width="400">
<tr bgcolor="#FFFFFF">
<td colspan="2"><div align="center"><strong>FORM EDIT ANGGOTA</strong></div></td>
</tr>

<?php
mysql_connect("localhost","root","");
mysql_select_db("toko_buku");

$tampil="select*from anggota where no_id='$_GET[no_id]'";
$edit=mysql_query($tampil);
$r=mysql_fetch_array($edit);
?>

<tr bgcolor="#FFFFFF">
<td>Nomor Id</td>
<td><label><input type="text" name="no_id" value="<?php echo" $r[no_id]";?>">

</label></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Nama</td>
<td><label><input type="text" name="nama" <?php echo" value='$r[nama]'";?>>
</label>
</td>
</tr>
<tr>
<td>Alamat</td>
<td><label><textarea name="alamat" <?php echo" value='$r[alamat]'";?>>
</textarea></label>
</td>
</tr>
<tr>
<td>Jenis</td>
<td><label><select name="jenis">
<?php echo" <option value='$r[jenis]'>'$r[jenis]'</select>";?>
<option value="pria">Pria</option>
<option value="wanita">Wanita</option>
</select>
</label>
</td>
</tr>
<tr>
<td>Status</td>
<td><label><input type="radio" name="status" value="aktif" checked>Aktif
<input type="radio" name="status" value="nonaktif">Nonaktif</label>
</td>
</tr>
<tr>
<td>Password</td>
<td><label><input type="password" name="password" <?php echo" value='$r[password]'";?>>
</label>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Simpan"><input type="reset" value="Batal">
</td>
</tr>
</table>
</form>
</body>
</html>

Bagas Pramudita 3:56am Oct 13
Pastikan sudah memanggil array, contoh.

$sql = mysql_query("select*from anggota where no_id='$_GET[no_id]'");
$tampil = mysql_array($sql);

echo $tampil['no_id'];

Trio Ferdiansyah 3:58am Oct 13
Om Bagas : <?php
mysql_connect("localhost","root","");
mysql_select_db("toko_buku");

$tampil="select*from anggota where no_id='$_GET[no_id]'";
$edit=mysql_query($tampil);
$r=mysql_fetch_array($edit);
?>

masih ga bisa

Andi Sholihin 3:59am Oct 13
<td><label><input type="text" name="no_id" value="<?php echo" $r['no_id']";?>">

Bagas Pramudita 4:01am Oct 13
Atau No ID nya bisa dijadikan variabel dulu.

<?php
mysql_connect('localhost,'root','','');
mysql_select_db('toko_buku');

$NoID = $_GET['no_id'];

$kueri = mysql_query("SELECT * FROM anggota WHERE no_id='$NoID'");
$tampil = mysql_fetch_array($kueri);
?>

mysql_fetch_array juga bisa diganti dengan mysql_fetch_assoc

#CMIIW

Bagas Pramudita 4:02am Oct 13
<input type="text" value="<?php echo $tampil['no_id']; ?>">

Trio Ferdiansyah 4:04am Oct 13
udah bikin variable..tetep ga mau yaa..

#bingung

Kist Tanto 4:14am Oct 13
Coba ganti dahulu atau diisi langsung id nya mw nampilin gak:

misal
$tampil="select * from anggota where no_id=1'";

Zakky 4:16am Oct 13
itu $_GET['no_id'] belum ada valuenya, atau url ?no_id= belum direquest. Tinggal tambahi issset aja

if(isset($_GET['no_id'])) {
$tampil="select*from anggota where no_id='$_GET[no_id]'";
$edit=mysql_query($tampil);
$r=mysql_fetch_array($edit);
}

atau kalau gak mau ribet tinggal tambahin jadi @ jadi @$_GET['no_id']

Trio Ferdiansyah 4:23am Oct 13
masih tetep ga bisa yaa..

Zakky : utk $_GET['no_id']; udah ada value'e koo

Wahyu Raja Butar-Butar 4:23am Oct 13
mungkin kurang perulangnnya kali. kek gini
while ($row1 = mysql_fetch_array($q)){
echo "<option value=$row1[kota]>$row1[kota]</
option>";
}

Zakky 4:24am Oct 13
masak di tambahi @ jadi @$_GET['no_id'] error-nya gak hilang? :/
aneh

Zakky 4:31am Oct 13
coba tu php-nya rubah jadi kayak gini

<?php
if(isset($_GET['no_id'])) {
mysql_connect("localhost","root","");
mysql_select_db("toko_buku");

$tampil="SELECT * FROM anggota WHERE no_id=".@$_GET['no_id'];
$edit=mysql_query($tampil);
$r=mysql_fetch_array($edit);
}
?>

kl masih tetep gak bisa ane nyerah aja :D

Trio Ferdiansyah 4:35am Oct 13
masih ga bisa om

Tonii Arisandii 4:39am Oct 13
share url yang udah kebentuk ,

Muhamad Najib 4:40am Oct 13
Itu ni_id nya rubah jadi $no_id...

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