Multiple forms to one MySql table - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Multiple forms to one MySql table (/showthread.php?tid=36151) |
Multiple forms to one MySql table - El Forum - 11-23-2010 [eluser]Todlerone[/eluser] Hello all and TY in advance. I have two forms that add to the same MySql table. In my model I have tried to parse the data depending on which form they came from. When I try it I get a: A Database Error Occurred You must use the "set" method to update an entry. I'm trying to insert new data, not alter existing data. Code: <?php TY Multiple forms to one MySql table - El Forum - 11-23-2010 [eluser]teampoop[/eluser] This looks right to me. The only thing I can suggest is doing a echo $this->db->last_query() and see what the active record is trying to create.. HTH Multiple forms to one MySql table - El Forum - 11-23-2010 [eluser]Bart Mebane[/eluser] It's possible you would get that message if none of the conditions are true and $da is empty. Multiple forms to one MySql table - El Forum - 11-23-2010 [eluser]Todlerone[/eluser] TY teampoop. I tried adding a few echo's to pinpoint out my location. As it turns out. My last if statement comes from the form to add a scheduled appointment. The "fromform" field is a hidden element for me to check. It doesn't appear to enter this if/statement after the form submission. I haven't used hidden fields before. Code: if ($this->input->post('fromform') == 'yes'){ |