I rewrote the sqlInsert function this morning. Here is how it works:
When sqlInsert is requested, the insert table and the core_sequence table
are locked.
getSequence is called. It returns the next id of that table.
The table gets its insertion with the new ID. If successful, the sequence
table is updated.
Notes:
getSequence pulls the max id from the core.
The core sequence numbers are not populated until the first insert is called.
Deleting a row does not effect the sequence.
Inserting a row outside of sqlInsert will not effect the sequencing. It
makes sure that it is the highest number.
If the insert fails, the sequence is not updated.
The incrementing is invisible: you don't have to indicate the column to
increment any more.
I am going to commit the current version. It works with the exact same
parameters. I do want to change the parameters around however and remove
the idColumn row (it is no longer used) after approval by everyone.
Thanks,
Matthew McNaney
Internet Systems Architect
Electronic Student Services
Email: ma...@tu...
URL: http://phpwebsite.appstate.edu
Phone: 828-262-6493
|