Quantcast
Channel: if - else in multiple update in one query - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Barmar for if - else in multiple update in one query

Set a variable based on the condition.Also, you don't need to use prepare() and bindParam() in the loop. You prepare and bind once, then execute in the loop. bindParam() binds to references, so you...

View Article


if - else in multiple update in one query

I have an issue with this query:foreach ($_POST['cod'] as $i => $cod) { $sth = $conn->prepare("UPDATE LPRODALMACEN SET `existencia` = `existencia` + :comprado WHERE `cod` = :cod");...

View Article

Browsing latest articles
Browse All 2 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>