What's Broken? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: What's Broken? (/showthread.php?tid=33593) |
What's Broken? - El Forum - 09-01-2010 [eluser]Bionicjoe[/eluser] I changed something awhile back & I guess I didn't test it. Now I can't fix whatever I changed? Trying to insert a record. I get error Quote:Message: Undefined index: addupdate NOTE: If I uncomment the redirect I'll see the error & the page redirects quickly with the update inserted into the DB. But why the error? Code: function addupdate() { Model Code: function addupdate($id, $data) What's Broken? - El Forum - 09-01-2010 [eluser]WanWizard[/eluser] The only line in your example that contains that index is Code: $this->outage_model->addupdate($_POST['addupdate'], $_POST); Since you don't tell us where this error occured, I assume that $_POST doesn't contain a field called 'addupdate'. What's Broken? - El Forum - 09-01-2010 [eluser]jdav3579[/eluser] Can you post the form? What's Broken? - El Forum - 09-01-2010 [eluser]jdav3579[/eluser] Sorry WanWizard, was reading it when you posted. I agree though. What's Broken? - El Forum - 09-01-2010 [eluser]Bionicjoe[/eluser] Oh wow. I really don't understand things I think. 'addupdate' is the name of my function in the model. Code: echo form_open('outage/addupdate'); What's Broken? - El Forum - 09-01-2010 [eluser]WanWizard[/eluser] Possible. But the error said "Undefined index". Which has nothing to do with method names, an index is an array index. And as $_POST is an array, and 'addupdate' in key in that array that you reference, it is my assumption that that like is causing the error. What's Broken? - El Forum - 09-01-2010 [eluser]Bionicjoe[/eluser] Thanks. Figuring things out now, but I have a new problem. In several Form Submits I get the following error just before the redirect, but all data makes it into the DB. Quote:Message: preg_match() expects parameter 2 to be string, array given I'd really like to understand this error. What's Broken? - El Forum - 09-01-2010 [eluser]WanWizard[/eluser] If this is your level of understanding, perhaps you should consider some additional development/PHP training? The message is very clear. You have called a function defined in the URL helper with the wrong type of parameter. Simply looking in the file mentioned, at the line mentioned, would have told you want you did wrong. I checked, and it's pretty obvious, but I leave it to you as a training excercise. What's Broken? - El Forum - 09-01-2010 [eluser]Bionicjoe[/eluser] I'm an idiot. I understood what the error was saying, but couldn't figure out why this had shown up 'all of the sudden'. Think I copy/pasted something awhile ago & just didn't check it. Sleep helps. Code: $link = 'outage/editoutage/' . $_POST['outageid']; What's Broken? - El Forum - 09-02-2010 [eluser]WanWizard[/eluser] hehehe... I solved that problem with an espresso machine on my desk. |