Query int

Jmnote (토론 | 기여)님의 2012년 1월 2일 (월) 15:50 판
  • 쿼리 결과를 int로 가져오기.
  • 주로 COUNT를 위해 사용.
function intQuery($qry) {
	$result = mysql_query($qry);
	$row = mysql_fetch_array($result, MYSQL_NUM);
	return $row[0];
}

$cnt1 = intQuery("SELECT COUNT(*) FROM table1");
$cnt2 = intQuery("SELECT COUNT(*) FROM table2 WHERE no='1'");
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}