MySQL foreign key Value insert |
I made two tables
Table Name Column Name debit -> id (primary key), accountname , vid (foreign key reference to voucher.id) voucher -> id (primary key), voucher_no, I want to add voucher id no as the vid field. How do I do that with codeigniter ??? Do i need to use LAST_INSERT_QUERY(), custom fucntion? Please help me.
Hello,
I'm not sure about what you need, so can you please explain more clearly your problem ? Can you post your controller/model/view code ? Maybe I'll can help you then... Thanks !
I think $this->db->insert_id(); will solve your problem
check this URL: http://www.codeigniter.com/userguide3/da...lpers.html
|
Welcome Guest, Not a member yet? Register Sign In |