update() public static méthode

Method to update a record in the database
public static update ( string $jarr, string $use = null ) : array
$jarr string SQL update in JSON/ARRAY format
$use string OPTIONAL Name of the database defined as a new connection instance
Résultat array Returns an array with the number of rows affected by update operation
Exemple #1
0
 /**
  * Update Where
  * 
  * */
 public function updateWhere($desc, $id)
 {
     // SQL update in JSON format
     $json = ' query: [ { table: "books" , values: { description: "' . $desc . '" } , where: { id: ' . $id . ' } } ] ';
     // Executes the SQL and stores the result
     $result = PDO4You::update($json);
     echo '<div class="code title">Demo with the old method PDO4You::update()</div>';
     echo '<div class="code debug">PDO4You::update(' . $this->getQuery($json) . '); ' . $this->getResult($result) . '</div>';
 }