Senin, 22 Juli 2013

PHP Indonesia - Facebook: om ane pake fungsi ini $select=mysql_query("SELE...

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. NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
om ane pake fungsi ini $select=mysql_query("SELE...
Jul 23rd 2013, 02:43, by Tonii Arisandii

Tonii Arisandii 2:43am Jul 23
om ane pake fungsi ini

$select=mysql_query("SELECT COUNT(*)FROM tbl_nilai WHERE id='1'");
$tampilselect=mysql_num_rows($select);

echo $tampilselect;

k hasilnya 1 ya ? padahal tidak ada data sama sekali dalam tabel ?

ane coba di phpmyadmin hasilnya 0 .. mohon bantuannya om

Cahya Dsn 2:55am Jul 23
[genius]... kalo pake SELECT COUNT(*) FROM tbl... kenapa gak pake mysql_fetch_row() ? tanya kenapa? kalo pake mysql_num_rows() mengapa query-nya nggak SELECT * FROM tbl...? .. ah sudahlah.. ane cuman asal koming...

Tonii Arisandii 2:57am Jul 23
om penjelasan lebih lanjut donk ,, hasilnya malah array ,, gtu om

Ramdhan Nurrachman 2:58am Jul 23
mysql_num_rows itu bukan jumlah data tapi jumlah baris.

Deni Tri Hartanto 2:58am Jul 23
select count akan menghasilkan 1 baris berisi data total query anda,
klo ditarik dgn num_rows ya keluar 1 kan select count() menghasilkan 1 baris,

maka klo make select count() yang hrus anda lakukan adalah menarik value dari baris yang dihasilkan count()

Ramdhan Nurrachman 3:00am Jul 23
count juga bisa lebih dari satu baris.

Deni Tri Hartanto 3:01am Jul 23
bisa lah lebih satu baris tergantung aggregat & bentuk query dia,
tapi query dia kan simple count yang menghasilkan 1 baris,
ntar klo dijelaskan lebih kesana malah lebih lieur TS nya
:p

Tonii Arisandii 3:02am Jul 23
Baik om ,, ane salah mengartikan arti kata Count dan mysql_num_rows ,, sekarang ane udah ngerti ,, heheheh

mungkin pake seperti ini saja cukup ya ??

mysql_query("SELECT * FROM tbl_name WHERE id=''");

mysql_num_rows();

Zainal Achmad WongCupas 3:05am Jul 23
emang bnr isinya 1 yaitu 0.

Tonii Arisandii 3:06am Jul 23
nah kalo misalkan ane pake select count nie om ,, fungsi php yng cocok untuk menmpilkan jumlah baris dari semua tabel itu apa ya om ?

Zainal Achmad WongCupas 3:10am Jul 23
mysql_fetch_row

Tonii Arisandii 3:11am Jul 23
makasaih om . hehehhehe ane coba nanti ,,

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