Re: Getting rows in a db...

From: Date: Thu, 02 Aug 2001 06:12:31 +0000
Subject: Re: Getting rows in a db...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60840@lists.php.net to get a copy of this message
On Thu, 2 Aug 2001 14:57, Chris Cocuzzo wrote: > hey- > > if I do this: > > $query = "SELECT user FROM table WHERE cat='band'"; > $result = mysql_query($query,$conn); > $rows = mysql_num_rows($result); > > will I get something back from the $rows variable, or am I using the > mysql_num_rows() function incorrectly. What I'm trying to do is get the > number of rows returned as a result of that specific sql statement and > query. > > thanks > chris That should show the number of rows returned by the query, providing there is a successful result. Try it! -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Shotgun wedding: a case of wife or death.

« previous php.general (#60840) next »