We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Update not working

hi,

I can't update and i don't know why.

My code :

$devis = new Devis();
        //DebugBreak("[email protected];d=1,p=0");
        $result = $devis->findFirst(
            [
                "conditions" => "ID_Devis = ?1",
                "bind" => 
                [
                    1 => $id
                ]
            ]
        );

        $status = new Status();

        $s = $status->findFirst(
            [
                "conditions" => "Libelle = ?1",
                "bind" =>
                [
                    1 => "Valide"
                ]
            ]
        );

        $result->ID_Status = $s->ID_Status;

        $result->update();

And the ID_Status is different

function update return TRUE. So why i haven't an update ?

please check this


var_dump($result->ID_Status, $s->ID_Status);

if ($result->updated() === false) {
    echo implode(' ', $result->getMessages());
}

Other idea, check tables and models are equals.

Good luck



4.2k

Hi, the function update returned TRUE, so your code not help me.

There was an update but with the bad id. The problem is solved.