PHP - Mengambil Satu Data Dan Jumlah Data
Untuk mengambil satu data di php
index.php
<?php
mysql_connect("localhost","root","");
mysql_select_db("dblogin");
$ambil = mysql_query("select * from tbusers");
$data = mysql_fetch_array($ambil);
echo $data[1];
?>
Untuk mengampilkan jumlah data
index.php
<?php
mysql_connect("localhost","root","");
mysql_select_db("dblogin");
$ambil = mysql_query("select * from tbusers");
$data = mysql_num_rows($ambil);
echo $data;
?>
index.php
<?php
mysql_connect("localhost","root","");
mysql_select_db("dblogin");
$ambil = mysql_query("select * from tbusers");
$data = mysql_fetch_array($ambil);
echo $data[1];
?>
Untuk mengampilkan jumlah data
index.php
<?php
mysql_connect("localhost","root","");
mysql_select_db("dblogin");
$ambil = mysql_query("select * from tbusers");
$data = mysql_num_rows($ambil);
echo $data;
?>
PHP - Mengambil Satu Data Dan Jumlah Data
Reviewed by Leo
on
08:17
Rating:
No comments