langtusitinh225
02-03-2010, 17:13
$sql = "select field from table where field = ...";
$result = mysql_query($sql);
echo mysql_num_rows($result);
$sql = "select count(field) as X from table where feild = ...";
$result = mysql_query($sql);
while ($num = mysql_fetch_array($result))
{
echo $num['X'];
}
Cho em hỏi là dùng cái nào tốt hơn, ưu nhược điểm hay 2 cái như nhau
Cám ơn
$result = mysql_query($sql);
echo mysql_num_rows($result);
$sql = "select count(field) as X from table where feild = ...";
$result = mysql_query($sql);
while ($num = mysql_fetch_array($result))
{
echo $num['X'];
}
Cho em hỏi là dùng cái nào tốt hơn, ưu nhược điểm hay 2 cái như nhau
Cám ơn