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..
Raadha
0
Newbie Poster
Recommended Answers
Jump to PostMake certain your query string is building correctly, check for erros and based on This You might need to free the results.
Change to free results:
for ($i = 0; …
Jump to PostMight 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
Raadha
0
Newbie Poster
Kyle Wiering
17
Engineering Manager
Raadha
0
Newbie Poster
Kyle Wiering
17
Engineering Manager
Raadha
0
Newbie Poster
Raadha
0
Newbie Poster
Kyle Wiering
17
Engineering Manager
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.