Fixed some bugs. Now if I could only get LAST_INSERT_ID() to do what it's supposed to, we'd be home free.