We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    $modx->db->update has a small error, found out the hard way messing with the example for to much time and asking Jared for wisdom and he saw the flaw. here is the error:
    $table = $modx->getFullTableName("site_content");
    $fields = array(
         "pagetitle" => "New Title",
         "alias" => "new-alias",
         "menuindex" => 2,
         "published" => 1
         )
    $rows_affected = $modx->db->update($fields, $table, "id = 45");
    

    and the good version:
    $table = $modx->getFullTableName("site_content");
    $fields = array(
         "pagetitle" => "New Title",
         "alias" => "new-alias",
         "menuindex" => 2,
         "published" => 1
         );
    $rows_affected = $modx->db->update($fields, $table, "id = 45");
    


    Maybe it could be fixed for other people.

    Dimmy
      follow me on twitter: @dimmy01