Skip to content

Commit

Permalink
change in config.sample to rollback if query failed
Browse files Browse the repository at this point in the history
  • Loading branch information
nickinuse committed Jan 24, 2010
1 parent 6dbbec3 commit 0ff0350
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config.sample.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
} }
function _sql_hook($sql) { function _sql_hook($sql) {
global $config; global $config;
if ($config['rollback'])
return FALSE;
if (empty($config['execute'])) if (empty($config['execute']))
return "\n".$sql; return "\n".$sql;
$result = $config['adapter_query']($sql); $result = $config['adapter_query']($sql);
if (!$result) if (!$result) {
{
echo("\n\nInvalid query: ".$config['adapter_error']()."\n"); echo("\n\nInvalid query: ".$config['adapter_error']()."\n");
$config['rollback']=true; $config['rollback']=true;
} }
Expand Down

0 comments on commit 0ff0350

Please sign in to comment.