Answers for "resullt all update knex mysql"

SQL
0

resullt all update knex mysql

const {id,name} = req.body;
    const subQuery = knex('client').select('id').where({id})
    subQuery.then(response=>{
    if(response.length>0){
        subQuery.update({name})
        .then(resp=>{
            res.json('update done')
        })
        .catch(err=>{res.json(err)})
    }
    else{
        res.json('update failed')
     }
})
.catch(err=>{res.json(err)})
Posted by: Guest on June-16-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language