Low cost ecommerce web development India flash website design

Row Counting with Classes


Let’s look again at the classes we’ve been developing throughout this section. We
can add the ability to find out the number of rows selected by introducing the
following method to the MySQLResult class:
File: Database/MySQL.php (in SPLIB) (excerpt)
/**
* Returns the number of rows selected
* @return int
* @access public
*/
function size()
{
return mysql_num_rows($this->query);
}
Here’s how to use it:
File: 15.php (excerpt)
// Connect to MySQL
$db = &new MySQL($host, $dbUser, $dbPass, $dbName);
Chapter 3: PHP and MySQL

website designer freelance ASP PHP ecommerce web developer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110