public function InstapageCmsPluginDrupal7Connector::getResults in Instapage plugin 8.3
Same name and namespace in other branches
- 7.3 core/connectors/InstapageCmsPluginDrupal7Connector.php \InstapageCmsPluginDrupal7Connector::getResults()
Executes the query and returns a list of results.
Parameters
string $sql SQL to execute. %s can be used to output pre-formatted values. Values for %s can be passed as arguments for this function.:
Return value
mixed Array of results, false on error.
2 calls to InstapageCmsPluginDrupal7Connector::getResults()
- InstapageCmsPluginDrupal7Connector::getPostSlugs in core/
connectors/ InstapageCmsPluginDrupal7Connector.php - Gets the list of slugs used by Drupal 7 posts.
- InstapageCmsPluginDrupal7Connector::isProhibitedPostSlug in core/
connectors/ InstapageCmsPluginDrupal7Connector.php - Checks if given slug is prohibited in terms of publishing a landing page. If it's free - will return false. Otherwise an array with slug details will be returned
File
- core/
connectors/ InstapageCmsPluginDrupal7Connector.php, line 310
Class
- InstapageCmsPluginDrupal7Connector
- Class that utilizes native Drupal 7 functions to perform actions like remote requests and DB operations.
Code
public function getResults($sql) {
$args = func_get_args();
array_shift($args);
$args = $this
->prepareFunctionArgs($args);
$sql = $this
->prepare($sql);
try {
$result = db_query($sql, $args);
$resultArray = $result
->fetchAll(PDO::FETCH_OBJ);
if (!is_array($resultArray)) {
return array();
}
return $resultArray;
} catch (Exception $e) {
$this
->logDbError($e, $sql);
return false;
}
}