public static function executarSelect($sql) { $connection = new ConnectionUtil(); $connection->query = mysql_query($sql, $connection->conn); $resultset = $connection->query; $connection->fecharConexao(); $i = 0; while ($linha = mysql_fetch_array($resultset)) { $array[$i] = $linha; $i++; } if ($i == 0) { return null; } else { return $array; } }
/** * * This method returns the metrics about a URL or set of URLs. * * @param objectURL * @param col This field filters the data to get only specific columns * col = 0 fetches all the data * @return */ public function getUrlMetrics($objectURL, $col = 0) { $urlToFetch = "http://lsapi.seomoz.com/linkscape/url-metrics/" . urlencode($objectURL) . "?" . Authenticator::getInstance()->getAuthenticationStr(); if ($col > 0) { $urlToFetch = $urlToFetch . "&Cols=" . $col; } $response = ConnectionUtil::makeRequest($urlToFetch); return $response; }
/** * This method returns the metrics about many URLs on a given subdomain * * @param objectURL * @param col A set of metrics can be requested by indicating them as bit flags in the Cols query parameter. * @param offset The start record of the page can be specified using the Offset parameter * @param limit The size of the page can by specified using the Limit parameter. * @return */ public function getTopPages($objectURL, $col = 0, $offset = -1, $limit = -1) { $urlToFetch = "http://lsapi.seomoz.com/linkscape/top-pages/" . urlencode($objectURL) . "?" . $this->authenticator->getAuthenticationStr(); if ($offset >= 0) { $urlToFetch = $urlToFetch . "&Offset=" . $offset; } if ($limit >= 0) { $urlToFetch = $urlToFetch . "&Limit=" . $limit; } if ($col > 0) { $urlToFetch = $urlToFetch . "&Cols=" . $col; } $response = ConnectionUtil::makeRequest($urlToFetch); return $response; }
/** * This method returns a set of anchor text terms of phrases aggregated across links to a page or domain. * * @param objectURL * @param scope determines the scope of the link, and takes one of the following values: * phrase_to_page: returns a set of phrases found in links to the specified page * phrase_to_subdomain: returns a set of phrases found in links to the specified subdomain * phrase_to_domain: returns a set of phrases found in links to the specified root domain * term_to_page: returns a set of terms found in links to the specified page * term_to_subdomain: returns a a set of terms found in links to the specified subdomain * term_to_domain: returns a a set of terms found in links to the specified root domain * @param sort determines the sorting of the links, in combination with limit and offset, this allows fast access to the top links by several orders: * domains_linking_page: the phrases or terms found in links from the most number of root domains linking are returned first * @param col determines what fields are returned * @param offset The start record of the page can be specified using the Offset parameter * @param limit The size of the page can by specified using the Limit parameter. * @return a set of anchor text terms of phrases aggregated across links to a page or domain. */ public function getAnchorText($objectURL, $scope = null, $sort = null, $col = 0, $offset = -1, $limit = -1) { $urlToFetch = "http://lsapi.seomoz.com/linkscape/anchor-text/" . urlencode($objectURL) . "?" . $this->authenticator->getAuthenticationStr(); if ($scope != null) { $urlToFetch = $urlToFetch . "&Scope=" . $scope; } if ($sort != null) { $urlToFetch = $urlToFetch . "&Sort=" . $sort; } if ($col > 0) { $urlToFetch = $urlToFetch . "&Cols=" . $col; } if ($offset >= 0) { $urlToFetch = $urlToFetch . "&Offset=" . $offset; } if ($limit >= 0) { $urlToFetch = $urlToFetch . "&Limit=" . $limit; } $response = ConnectionUtil::makeRequest($urlToFetch); return $response; }
public static function getByNome($instituto) { $sql = "select * from Instituto where Nome = '" . $instituto . "'"; $resultset = ConnectionUtil::executarSelect($sql); return InstitutoDao::parse($resultset[0]); }
public static function getByNome($curso) { $sql = "select * from Curso where Nome = '" . $curso . "'"; $resultset = ConnectionUtil::executarSelect($sql); return CursoDao::parse($resultset[0]); }