yandex
loader

please wait

  • NeelKamal Jha Mar-14-2019 06:17:52 AM ( 2 months ago )
    try{
        $abcd = $cat->save();
        var_dump($abcd);exit; // returns true
    } catch (Exception $e){
        echo '
    ';print_r($e);exit;
    }

    Dumping the data just before save function is printing all correct.

    Tried this code - it dumps as true but not getting updated in database. I have tried all known scenarios. Any exceptional cases that this can happen.?

    primary key, id , .... and some other checks are already done. But no progress.

  • Naveen Shastri Mar-14-2019 06:19:19 AM ( 2 months ago )

     

     

    you need to use Cat Model while saving :

    like $cat=new Cat(); for creating new record or,

    $cat=Cat::find($id); while updating exiting record

    try{
        $cat=new Cat();
        $cat->some_column='some_value';   
        $abcd = $cat->save();
        var_dump($abcd);exit; // returns true
    } catch (Exception $e){
        echo '
    ';print_r($e);exit;
    }

Please login

Similar Discussion

Recommended For You