IF Query - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1) +--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25) +--- Thread: IF Query (/showthread.php?tid=70154) |
IF Query - Germanikus - 03-01-2018 Hello everybody, I have a problem with an IF. For this query, the total amount of the article should be checked. If it is exactly 0, an update will be executed. But if it is above that, it should be ignored. Example: The database says I have 5 batteries. I sell 5, so an update will be executed. Here are the code: Model PHP Code: public function karte_gelagert_sum($slug = false) { view: Code: <?php echo form_open('Karte/insert_artikel'); ?> I do not understand why this does not update. RE: IF Query - InsiteFX - 03-02-2018 Try this, first get it to work then tweak it out. PHP Code: public function insert_artikel($slug) |