runs query - wrapper for ExecQuery

@param string $qry
@return int
960503
final function Query($qry)
    {
        $GLOBALS['qry_count']++;
        $GLOBALS['qry'].=$GLOBALS['qry_count'].':'.$qry."\n";

        $this->last_query = $qry;

        $this->query_result = $this->ExecQuery($qry);

        if ($this->query_result) {
            $this->SetQuerySummary();
            return $this->query_result;
        }

        $this->SetErrCode();
        if (!$this->show_errors) {
            $this->WriteError($this->GetErr());
        }

        return false;
    }
802357
public function execute()
    {
        $qe = new QueryExecuter($this->repo, $this->predicate, $this->limit, $this->orderBy);

        return $qe->run();
    }
407114
public function update($q, $data)
    {
        if (is_string($q)) {
            $this->defaults['table'] = $q;
            $q = [];
        }
        extract($this->defaults);
        extract($q);

        if (!$table)
            throw new Exception("table [$tabel] not defined", 1);

        if (!$limit)
            $limit = 1;

        $sql =  'UPDATE ' . $table . ' SET ';
        $sep = '';
        foreach ($data as $k=>$v) {
            if ($k == 'id')
                continue;

            $sql .= $sep . "$k = :$k";
            $sep = ', ';
        }
        $sql .=
            ($where ?   ' WHERE '    . $where   : '' );
            # ' LIMIT '    . $limit;

        return $this->query($sql, $data);
    }
275710
public function countAll($executeQuery = true)
    {
        $queryBuilder = $this->createQueryBuilder('p')
            ->select('COUNT(p)');

        return $executeQuery ? $queryBuilder->getQuery()->getSingleScalarResult() : $queryBuilder;
    }
412489
function _query($sql,$inputarr=false)
	{
	global $ADODB_COUNTRECS;

		if ($ADODB_COUNTRECS == false && ADODB_PHPVER >= 0x4300)
			return sybase_unbuffered_query($sql,$this->_connectionID);
		else
			return sybase_query($sql,$this->_connectionID);
	}
465071
public function executeNone(string $query): int
  {
    $this->realQuery($query);

    $n = $this->mysqli->affected_rows;

    if ($this->mysqli->more_results()) $this->mysqli->next_result();

    return $n;
  }
586599
static function doSelectRS(Query $q = null) {
		$q = $q ? clone $q : static::getQuery();

		if (!$q->getTable()) {
			$q->setTable(static::getTableName());
		}

		return $q->doSelect(static::getConnection());
	}
812256
protected function getQueryTotal(QueryBuilder $qb): int
    {
        $countQuery = clone $qb;

        if (\count($qb->getParameters()) > 0) {
            $countQuery->setParameters($qb->getParameters());
        }

        if ($countQuery->getDQLPart('orderBy')) {
            $countQuery->resetDQLPart('orderBy');
        }

        $countQuery->setMaxResults(null);
        $countQuery->setFirstResult(0);

        $queryAlias = $qb->getAllAliases()[0];
        $countQuery->select(sprintf('count(DISTINCT %s.%s) as total', $queryAlias, 'id'));

        return $countQuery->getQuery()->getSingleScalarResult();
    }
1184535
public function execSql(string $sql): int
    {
        $result = $this->pdo->exec($sql);
        if ($result === false) {
            $err = $this->errorInfo();
            throw new \Exception('['.$err[0].']'.$err[2]);
        }
        return $result;
    }
142739
protected function processSubQuery($subQuery, $context)
    {
        if ($subQuery instanceof Query) {
            return $this->processQuery($subQuery, $context);
        }

        return $subQuery;
    }
208101
private function totalRecordsQuery(): int
    {
        return $this->totalIndividualsQuery()
            + $this->totalFamiliesQuery()
            + $this->totalNotesQuery()
            + $this->totalRepositoriesQuery()
            + $this->totalSourcesQuery();
    }
24745
function executeQuery($query) {

        try {

            $table = FALSE;

            if (!is_null($query) && is_string($query)) {
                $connection = $this->getConnection();
                $resultQry = mysql_query($query, $connection);

                if ($resultQry) {

                    if (mysql_num_rows($resultQry) != 0) {

                        $rowTemplate = array();
                        $terminar = FALSE;
                        $cntCols = mysql_num_fields($resultQry);
                        $cnt = 0;

                        while (!$terminar) {

                            $nombreCampo = mysql_field_name($resultQry, $cnt);

                            if ($nombreCampo) {
                                $rowTemplate[$nombreCampo] = $nombreCampo;
                                $cnt = $cnt + 1;
                            }

                            $terminar = (( $cntCols - $cnt ) == 0);
                        }

                        $table = array();

                        while ($fila = mysql_fetch_assoc($resultQry)) {

                            $rowAux = $rowTemplate;

                            foreach ($rowAux as $k => $v) {
                                $rowAux[$k] = $fila[$k];
                            }

                            $table[] = $rowAux;
                        }

                        mysql_free_result($resultQry);
                    }

                    mysql_close($connection);
                } else {
                    throw new \Exception("SQL Error: " . mysql_error());
                }
            }

            return $table;
        } catch (\Exception $pEx) {
            throw new \Exception("Fallo al ejecutar la query: " . $query . "  " . $pEx->getMessage());
        }
    }
1345329
private function _runQuery($query, $options)
    {
        $this->_testQueryStarts($query, '[select|show]');
        $statement = $this->_executeQuery($query, $options);
        if (is_object($statement) && $statement instanceof \PDOStatement) {
            return $statement;
        }
        else {
            $this->_error(FQDBException::INTERNAL_ASSERTION_FAIL, FQDBException::FQDB_CODE);
        }
    }
376431
public function execute(string $query, array $parameters = []): int
    {
        return $this->statement($query, $parameters)->rowCount();
    }
323002
public function count(Query $query)
        {
            $query->setTable($this);
            $query->generateCountSQL();

            $resultset = Statement::getPreparedStatement($query)->execute();
            return $resultset->getCount();
        }
572387
function queryRow($query, $resultType = MYSQLI_ASSOC)
  {
    $res = $this->q($query);
    if ($res->num_rows == 0)
      $row = false;
    else
      $row = $res->fetch_array($resultType);
    $res->close();
    return $row;
  }
598650
final function GetCol($qry, $offset = 0)
    {
        if ($this->lock_sel_data) {
            return array();
        }
        if ($this->Query($qry)) {
            $this->result = $this->Fetch($this->query_result, null, $offset);
            $this->SetDebugDump($offset);

            return $this->result[0];
        }
        return array();
    }