00010091_v2.patch

Administrator Admin, 2009-01-10 16:11

Download (1 KB)

View differences:

t3lib/class.t3lib_db.php (Arbeitskopie)
330 330
		return $output;
331 331
	}
332 332

  
333
	/**
334
	 * Counts the number of rows.
335
	 *
336
	 * @param	string		$field: Name of the field to use in the COUNT() expression (e.g. '*')
337
	 * @param	string		$table: Name of the table to count rows for
338
	 * @param	string		$where: (optional) WHERE statement of the query
339
	 * @return	mixed		Number of rows counter (integer) or false if something went wrong (boolean)
340
	 */
341
	public function exec_SELECTcountRows($field, $table, $where = '') {
342
		$count = false;
343
		$resultSet = $this->exec_SELECTquery('COUNT(' . $field . ')', $table, $where);
344
		if ($resultSet !== false) {
345
			list($count) = $this->sql_fetch_row($resultSet);
346
			$this->sql_free_result($resultSet);
347
		}
348
		return $count;
349
	}
333 350

  
334 351

  
335 352

  
......
340 357

  
341 358

  
342 359

  
360

  
343 361
	/**************************************
344 362
	 *
345 363
	 * Query building