Skip to content

Instantly share code, notes, and snippets.

@ideesimple
Created December 14, 2010 15:26
Show Gist options
  • Save ideesimple/740570 to your computer and use it in GitHub Desktop.
Save ideesimple/740570 to your computer and use it in GitHub Desktop.
return single value results via xPDO
<?php
$stmt = $modx->query("SELECT MAX(id) FROM {$modx->getTableName('modResource')}");
$maxId = (integer) $stmt->fetch(PDO::FETCH_COLUMN);
$stmt->closeCursor();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment