What is the explanation or meaning of this code:
andPHP Code:$totalarr = count($opname) - 1;
Thank youPHP Code:$totalrows = mysql_num_rows($result);
$trows = $totalrows - 1;
What is the explanation or meaning of this code:
andPHP Code:$totalarr = count($opname) - 1;
Thank youPHP Code:$totalrows = mysql_num_rows($result);
$trows = $totalrows - 1;
Last edited by rhodarose; 12-13-2010 at 02:02 AM.
count() counts the number of elements in an array
mysql_num_rows() returns the amount of returned rows from a query.PHP Code:$array = array('Dog', 'Cat', 'Apple', 'Pear');
echo count($array); // 4
Jeremy | jfein.net
rhodarose (12-13-2010)
It depends on where it's being used - it's just subtracting one away probably for a reason that comes up later in the script. I dont know.
Jeremy | jfein.net
Bookmarks