Skip to content

Instantly share code, notes, and snippets.

@mavitm
Created September 22, 2017 10:20
Show Gist options
  • Save mavitm/8e3e1c9b70861ba2d1766e928c39ad80 to your computer and use it in GitHub Desktop.
Save mavitm/8e3e1c9b70861ba2d1766e928c39ad80 to your computer and use it in GitHub Desktop.
toSql binding
<?php
//throw new \October\Rain\Exception\ApplicationException(@intval($data['page']));
$sql = $query->toSql();
foreach($query->getBindings() as $binding)
{
$value = is_numeric($binding) ? $binding : "'".$binding."'";
$sql = preg_replace('/\?/', $value, $sql, 1);
}
throw new \October\Rain\Exception\ApplicationException($sql);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment