i have a database 'phar' which need to subract its values 'stk' through the request made and gets updated to the db. i used arrays to do subraction.. but not able to store back the values to the db in its position.. my calculations work perfect, but not able to store back..pls help..
Jump to Post
Might not need the mysqli_free_result() for an update query, might only be tied to select queries.
I don't know your exact dataset, or datamodel, but I suspect the query would be closer to this:
$result = mysqli_query($con, "UPDATE phar SET $stk = '$res[$i]' WHERE pro = '$pro' and $stk = …
All 7 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.