public boolean update (string | array $table, array $fields, array $values, [string | array $whereCondition], [array $dataTypes])
Updates data on a table using custom RBDM SQL syntax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | //Updating existing robot $success = $connection ->update( "robots" , array ( "name" ), array ( "New Astro Boy" ), "id = 101" ); //Next SQL sentence is sent to the database system UPDATE `robots` SET `name` = "Astro boy" WHERE id = 101 //Updating existing robot with array condition and $dataTypes $success = $connection ->update( "robots" , array ( "name" ), array ( "New Astro Boy" ), array ( 'conditions' => "id = ?" , 'bind' => array ( $some_unsafe_id ), 'bindTypes' => array (PDO::PARAM_INT) //use only if you use $dataTypes param ), array (PDO::PARAM_STR) ); |
Warning! If $whereCondition is string it not escaped.
Please login to continue.