Skip to content

Instantly share code, notes, and snippets.

@douggrubba
Created December 1, 2011 13:54
Show Gist options
  • Save douggrubba/1416883 to your computer and use it in GitHub Desktop.
Save douggrubba/1416883 to your computer and use it in GitHub Desktop.
hrm
//add support for the display id
$display_id = sprintf('(SELECT COALESCE(display_id, 0) + 1 FROM (SELECT MAX(display_id) AS display_id FROM '.DBPRE.'records WHERE project_id = %d) AS x)', $data['project_id']);
$this->db->set('display_id', $display_id, FALSE);
$this->db->insert(DBPRE . 'records', $data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment