[eluser]randomdriver[/eluser]
[quote author="alboyd" date="1254286232"]What a confusing set of responses to your initial question! I'm not even sure what the final answer was?!
I think in the end - the suggestion was that you create your $code in the controller and pass this to the model function to insert into the database - then in the controller you can continue on using the $code for other purposes?
The other option with what you initially had would be to check the result of the query ($insert i think you called it) - if OK return $code otherwise return FALSE.[/quote]
Yes, both would work or even the third option I posted passing the code from the controller into the model function via save($code). I guess I need to work on my question asking for future help.