![]() |
problem with posts update/edit - 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: problem with posts update/edit (/showthread.php?tid=5586) |
problem with posts update/edit - El Forum - 01-27-2008 [eluser]Tetek[/eluser] Hi all I have a problem with editing posts in my blog. look at this. controller Code: function editnews2() Editnews view Code: <html> ERROR: Quote:A PHP Error was encountered Can u see where is the mistake? problem with posts update/edit - El Forum - 01-27-2008 [eluser]Seppo[/eluser] Probably it´s here. Code: redirect('blog'.$_POST['id']); problem with posts update/edit - El Forum - 01-27-2008 [eluser]xwero[/eluser] I'm going to make a run down of (possible) problems i see - the id isn't posted because there is no input field with the name id - the $data['query'] should return only one row so the query code would be $this->db->get('entries')->row(); (php5) - because there is only one row you don't need the foreach in your view - the redirect should be redirect('blog/'.$_POST['id']); i guess - the $_POST should be validated before you add it to the sql statement problem with posts update/edit - El Forum - 01-27-2008 [eluser]David Rothera[/eluser] The script is saying it cant redirect you because some output has already been sent to the browser when it gave you the error about the undefined index. Could you try echo out $_iNews; right after you have set it to make sure it is what you expect it to be (namely and integer). |