Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
mysqlresult.php
1<?php
2namespace Bitrix\Main\DB;
3
4class MysqlResult extends Result
5{
7 protected $resultFields = null;
8
14 public function __construct($result, Connection $dbConnection, \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery = null)
15 {
16 parent::__construct($result, $dbConnection, $trackerQuery);
17 }
18
24 public function getSelectedRowsCount()
25 {
26 return mysql_num_rows($this->resource);
27 }
28
34 public function getFields()
35 {
36 if ($this->resultFields == null)
37 {
38 $this->resultFields = array();
39 if (is_resource($this->resource))
40 {
41 $numFields = mysql_num_fields($this->resource);
42 if ($numFields > 0 && $this->connection)
43 {
44 $helper = $this->connection->getSqlHelper();
45 for ($i = 0; $i < $numFields; $i++)
46 {
47 $name = mysql_field_name($this->resource, $i);
48 $type = mysql_field_type($this->resource, $i);
49
50 $this->resultFields[$name] = $helper->getFieldByColumnType($name, $type);
51 }
52 }
53 }
54 }
56 }
57
63 protected function fetchRowInternal()
64 {
65 return mysql_fetch_assoc($this->resource);
66 }
67}
__construct($result, Connection $dbConnection, \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery=null)