Make insert with select

0

I have a table named label, with varcharTag name and quant int 11.

When I insert into the label table, I have to increase the total quantity registered in bank +1 . But I do not know how to do this without having to do another query over and then add through php. Can you do this without the whole process of another query with PHP?

$querysql = $con->prepare("INSERT INTO rótulo(nomeTag, quant) VALUES(?,?)");
$querysql->bindValue(1, $nomeTag);
$querysql->bindValue(2, "SELECT quant+1 FROM rótulo"); // nessa linha qe eu ñ sei
$querysql->execute();

Can you do something like this? Can someone help me?

    
asked by anonymous 28.11.2017 / 16:31

0 answers