Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #resullt #update #knex #mysql
ADD COMMENT
Topic
Name
1+7 =