How to insert data from _POST - 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: How to insert data from _POST (/showthread.php?tid=23156) |
How to insert data from _POST - El Forum - 10-02-2009 [eluser]jabga[/eluser] Hi there. This is my addnews.php Code: <?php This is insertnews.php Code: <html> There are following errors occuring when I click on the submit button Code: A PHP Error was encountered Code: A PHP Error was encountered Code: A PHP Error was encountered How can I add news from insert form easily? Please tell me How to insert data from _POST - El Forum - 10-02-2009 [eluser]jabga[/eluser] Should I use helper or class or model ? I am trying to create a small website for practice. Here is my html design http://download.idiotsheep.com/Dulaanurguu Static.zip ok ok I hAve found it http://www.phpeveryday.com/articles/CodeIgniter-Form-Creating-Skeleton-P228.html How to insert data from _POST - El Forum - 10-02-2009 [eluser]n0xie[/eluser] You shouldn't put your sql in your view. It belongs in your model. Take a look at the CodeIgniter tutorials How to insert data from _POST - El Forum - 10-02-2009 [eluser]jabga[/eluser] Tnx, I have got it. i have finished watching CI tutorial and also this tutorial is very useful http://www.phpeveryday.com/articles/CodeIgniter-Form-Creating-Skeleton-P228.html Tnx How to insert data from _POST - El Forum - 10-02-2009 [eluser]anyshpm[/eluser] codeigniter tutorial is always helpful How to insert data from _POST - El Forum - 10-02-2009 [eluser]Zack Kitzmiller[/eluser] You were missing 's anyway. $_POST['title'] How to insert data from _POST - El Forum - 10-03-2009 [eluser]richfearless[/eluser] Try this Code: <?php $sql="INSERT INTO news (title, content, category) How to insert data from _POST - El Forum - 10-03-2009 [eluser]InsiteFX[/eluser] Data access should be done in your model! Like n0xie stated above. Enjoy InsiteFX |