Jumat, 06 September 2013

PHP Indonesia - Facebook: gan tanya lagi boleh gk ya ? maaf keseringan tanya...

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/ 
Mobile Game Development Course

Learn how to create awesome HTML5 games that run on iPhone, iPad, Android and Desktop! Sign up today for this $99 online course.
From our sponsors
gan tanya lagi boleh gk ya ? maaf keseringan tanya...
Sep 6th 2013, 17:29, by זי סוטשינהאַ

זי סוטשינהאַ 5:29pm Sep 6
gan tanya lagi boleh gk ya ? maaf keseringan tanya, maklum newbie.. hehehe
langsung aja ya..

<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("db_login") or die(mysql_error());
$result = mysql_query("SELECT id, nama FROM siswa");
while ($input = mysql_fetch_array($result)){
print_r ($input['nama']. "<br/>");
}?>

hasilnya adalah sebagai berikut :

Achmad Solichin
Chotimatul Musyarofah
Muhammad Lintang

nah pertanyaannya adalah.. gimana cara'a agar mengambil sala satu aja. jadi misal klo id achmad solichin login maka akan muncul nama achmad solichin..

mohon bantuannya ya.. :D

Aris Gates 5:33pm Sep 6
tambahkan ini gan mysql_query("SELECT id, nama FROM siswa where id='achmad solichin'");

Fazrin Mayer 5:38pm Sep 6
1. ambil ID yg login (biasanya ngambil dari session)
2. kyk atas ane, tambahin ke Query:
where id = $_SESSION['user_id']

Gunawan Mujur Wibisono 5:41pm Sep 6
mau naik level gk newbie.. pake mysqli sintax

זי סוטשינהאַ 5:44pm Sep 6
Kang Aris Gates seperti inikah ? kok gk ada muncul, gk ada error jga, hasil'a kosong..:D
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("db_login") or die(mysql_error());

$result = mysql_query("SELECT id, nama FROM siswa WHERE id='achmad solichin'");

while ($input = mysql_fetch_array($result)){
print_r ($input['nama']. "<br/>");
}
?>

זי סוטשינהאַ 5:48pm Sep 6
ok kang Fazrin, ane googling dlu, cari bahan.. sapa tau ketemu yg gituan.. :D

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