1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Database
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 /**
13 * MySQL database iterator.
14 *
15 * @link http://dev.mysql.com/doc/
16 * @since 12.1
17 * @deprecated 4.0 Use MySQLi or PDO MySQL instead
18 */
19 class JDatabaseIteratorMysql extends JDatabaseIterator
20 {
21 /**
22 * Get the number of rows in the result set for the executed SQL given by the cursor.
23 *
24 * @return integer The number of rows in the result set.
25 *
26 * @since 12.1
27 * @see Countable::count()
28 */
29 public function count()
30 {
31 return mysql_num_rows($this->cursor);
32 }
33
34 /**
35 * Method to fetch a row from the result set cursor as an object.
36 *
37 * @return mixed Either the next row from the result set or false if there are no more rows.
38 *
39 * @since 12.1
40 */
41 protected function fetchObject()
42 {
43 return mysql_fetch_object($this->cursor, $this->class);
44 }
45
46 /**
47 * Method to free up the memory used for the result set.
48 *
49 * @return void
50 *
51 * @since 12.1
52 */
53 protected function freeResult()
54 {
55 mysql_free_result($this->cursor);
56 }
57 }
58