projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring, finished with last insert ids.
[timetracker.git]
/
WEB-INF
/
lib
/
ttInvoiceHelper.class.php
diff --git
a/WEB-INF/lib/ttInvoiceHelper.class.php
b/WEB-INF/lib/ttInvoiceHelper.class.php
index
41dace0
..
0867ee1
100644
(file)
--- a/
WEB-INF/lib/ttInvoiceHelper.class.php
+++ b/
WEB-INF/lib/ttInvoiceHelper.class.php
@@
-332,11
+332,7
@@
class ttInvoiceHelper {
if (is_a($affected, 'PEAR_Error')) return false;
// Mark associated invoice items with invoice id.
if (is_a($affected, 'PEAR_Error')) return false;
// Mark associated invoice items with invoice id.
- $last_id = 0;
- $sql = "select last_insert_id() as last_insert_id";
- $res = $mdb2->query($sql);
- $val = $res->fetchRow();
- $last_id = $val['last_insert_id'];
+ $last_id = $mdb2->lastInsertID('tt_invoices', 'id');
// Our update sql is different depending on tracking mode.
if (MODE_TIME == $user->getTrackingMode()) {
// Our update sql is different depending on tracking mode.
if (MODE_TIME == $user->getTrackingMode()) {