note 19056 added to function.mysql-num-rows

From: Date: Thu, 14 Feb 2002 08:57:02 +0000
Subject: note 19056 added to function.mysql-num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-26603@lists.php.net to get a copy of this message
What if you wanted to count how many entries where added by the id? category: id subid url urlname and you had this enterred: 1 2 yahoo.com yahoo 2 2 google.com google 3 1 myserver.com server example: $query = "SELECT * FROM table where subid=2"; $result = mysql_query($query); $rows = mysql_num_rows($result); echo "Subid Entries: $rows<br>"; you would get this result: Rows: 2 Just say you wanted that to affect multiple subids. so you could get the result of: Subid Entries: 2 Subid Entries: 1 I always gets the last result only, and wanted to count all the related subids to get a count of how many went where. -- http://www.php.net/manual/en/function.mysql-num-rows.php http://master.php.net/manage/user-notes.php?action=edit+19056 http://master.php.net/manage/user-notes.php?action=delete+19056 http://master.php.net/manage/user-notes.php?action=reject+19056

« previous php.notes (#26603) next »