Skip to content

Instantly share code, notes, and snippets.

@pgmccann
Created October 5, 2015 14:14
Show Gist options
  • Save pgmccann/1509fc03b6bf858021dd to your computer and use it in GitHub Desktop.
Save pgmccann/1509fc03b6bf858021dd to your computer and use it in GitHub Desktop.
Execute Postgres Query
<?php
//Thanks to Swithun Crowe
function do_query($query, $params=array()) {
$result = pg_query_params($query, $params) or die('Query failed: ' . pg_last_error());
return $result;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment