Welcome Guest, Not a member yet? Register   Sign In
How to understand entities, save, hasChanged
#6

See your code here EXTRA BRACKET on if else statement
PHP Code:
if (!$original_OsmSkiResort->hasChanged()){
    echo "no change on record number ".$i.'</br>';
                // <-- closing if
              
            
} else { // <-- closing if with else
                $y $this->OsmSkiResortModel->save($OsmSkiResort) ;
    echo "save: ".$y.'</br>';
            }

// Should be like this

if (!$original_OsmSkiResort->hasChanged()){
    echo "no change on record number ".$i.'</br>';
} else {
    $y $this->OsmSkiResortModel->save($OsmSkiResort) ;
    echo "save: ".$y.'</br>';

What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: How to understand entities, save, hasChanged - by InsiteFX - 05-26-2024, 03:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB