RE: [PHP] Count function. (Newbie Question)

From: Date: Mon, 09 Apr 2001 16:45:27 +0000
Subject: RE: [PHP] Count function. (Newbie Question)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47827@lists.php.net to get a copy of this message
Hi There are 2 issues: You need to maintain a page counter You need to pass the page counter and the total page count from page to page You can do this via url params (xxx.html?page=$page_count&record_count=$record_count), sessions or cookies depending HTH -----Original Message----- From: Michael O'Neal [mailto:mike@thinkmango.com] Sent: Monday, April 09, 2001 9:32 AM To: php-general@lists.php.net Subject: [PHP] Count function. (Newbie Question) Hi, I'm trying to display a record count of some sort on a page I'm working on. For example, "Record 1 of 15". I can display the 1st number ok, but I'm a bit confused on what the count function should look like for the 2nd number (15, in this case). Here is my current (not working) code. > <?php > > $query = "SELECT count(*) FROM mango_pr"; > $result = mysql_query($query); > $record_count = mysql_fetch_row($result); > > >?> And then I'm calling the code with an "echo" later on: ><b><?php echo $record_count ?> </b></font> This obviously isn't right...can anyone offer any suggestions? Thanks, mto Michael O'Neal Web Producer/ Autocrosser ST 28 '89 Civic Si --------------------- M A N G O B O U L D E R --------------------- http://www.thinkmango.com e-mike@thinkmango.com p-303.442.1821 f-303.938.8507 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#47827) next »