Skip to content

Instantly share code, notes, and snippets.

@faiyazalam
Created May 21, 2018 13:58
Show Gist options
  • Save faiyazalam/db62b4a7f043362fb713b3359ea04cdb to your computer and use it in GitHub Desktop.
Save faiyazalam/db62b4a7f043362fb713b3359ea04cdb to your computer and use it in GitHub Desktop.
Raw sql query using Pimcore\Db class in PIMCORE 5
use Pimcore\Db;
$sql = "SELECT * from table_name where`id` = ?";
$stmt = Db::get()->prepare($sql);
$stmt->bindParam(1, 101, \PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetchAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment