config/orm.js
// An example of objColVals would be {name: Buffalo Chicken Burger with Blue Cheese Sauce, devoured: true}
An example of objColVals would be {name: Buffalo Chicken Burger with Blue Cheese Sauce, devoured: true}
An example of objColVals would be { name : Buffalo Chicken Burger with Blue Cheese Sauce devoured : true }
update(table, objColVals, condition, cb) {
    let queryString = `UPDATE ${table}`;
    queryString += " SET ";
    queryString += objToSql(objColVals);
    queryString += " WHERE ";
    queryString += condition;
    console.log(queryString);
    connection.query(queryString, (err, result) => {
      if (err) {
        throw err;
      }
      cb(result);
    });
  }
update ( table , objColVals , condition , cb ) { let queryString = ` ${ table } ` ; queryString += " SET " ; queryString += objToSql ( objColVals ) ; queryString += " WHERE " ; queryString += condition ; console . log ( queryString ) ; connection . query ( queryString , ( err , result ) => { if ( err ) { throw err ; } cb ( result ) ; } ) ; }
An example of objColVals would be {name: Buffalo Chicken Burger with Blue Cheese Sauce, devoured: true}
An example of objColVals would be { name : Buffalo Chicken Burger with Blue Cheese Sauce devoured : true }