![]() |
check insert process and redirect - 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: check insert process and redirect (/showthread.php?tid=21915) |
check insert process and redirect - El Forum - 08-24-2009 [eluser]Mostafa Hassan[/eluser] Hi all ... i have a db insert opertation Code: $result=$this->add_student_model->insert('students',$data); i want to check if operation complete or not ,, and redirect to another form in smarty template engine .. i use Code: if ($result) what is the alternative code in ci ? i searched the user guide but i ddnt found any thing ![]() thanks ![]() check insert process and redirect - El Forum - 08-24-2009 [eluser]tomcode[/eluser] Code: if ($result) Is that what You mean ? check insert process and redirect - El Forum - 08-24-2009 [eluser]Mostafa Hassan[/eluser] i tried this code before but it shows nothing when the insert operation done .. it's shows nothing (white page) !! thanks tomcode for reply check insert process and redirect - El Forum - 08-24-2009 [eluser]tomcode[/eluser] What do You have in Your views ? check insert process and redirect - El Forum - 08-24-2009 [eluser]Mostafa Hassan[/eluser] no tomcode i have no views but i tried this code .. have no views Code: if ($result) i tried just now anew code Code: if ($result=TRUE) it works fine !! now i need your help with redirecting to another page after showing "Done" and many thanks again check insert process and redirect - El Forum - 08-24-2009 [eluser]tomcode[/eluser] Code: // $result = TRUE is wrong, You could do $result == TRUE, but that's the same as : check insert process and redirect - El Forum - 08-24-2009 [eluser]Mostafa Hassan[/eluser] YES !!! it Works fine ... sooooo mannnnny thanks my friend TomCode ![]() i just want to ask u for a simple something in smarty template engine .. when i want to show amessage .. i dont have to make aview i just call this function Code: $SF->msg('my message here'); // smarty message this function show asimple view with the test "my message here" what about message function in ci .. check insert process and redirect - El Forum - 08-24-2009 [eluser]tomcode[/eluser] There is no message function in CI, only error messages show_404() and show_error(). Read the user guide for details. check insert process and redirect - El Forum - 08-24-2009 [eluser]Mostafa Hassan[/eluser] ok ,, thank you ![]() this comment Code: // $result = TRUE is wrong, You could do $result == TRUE, but that's the same as : Code: $result == TRUE that's mean variable result match letters (TRUE) but Code: $result = TRUE that's mean operation is done successfully and so many thanks tomcode hope for u great success ![]() |