note 47521 added to function.mysql-num-rows

From: Date: Thu, 18 Nov 2004 23:38:40 +0000
Subject: note 47521 added to function.mysql-num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-80728@lists.php.net to get a copy of this message
Re my last entry: This seems the best workaround to get an 'ordinary' loop going, with possibility of altering output according to row number (eg laying out a schedule) $rowno=mysql_num_rows($result); for ($i=0; $i<mysql_num_rows($result); $i++) { $row = mysql_fetch_assoc($result); print "<div class=\"showing\">"; print "<b>".$row['timeon']."-".$row['timeoff']."</b> ".$row['event']."<br />; if ($i!=$rowno-1) { print "other-html-within-sched-here</div>"; } else print "end-last-entry-html-here</div>"; } //close loop ---- Manual Page -- http://www.php.net/manual/en/function.mysql-num-rows.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47521 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47521&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47521&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47521&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47521&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47521&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47521&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47521&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80728) next »