1
i wanted to make a function where each time it is called the active plot table is decreased by 1, follows the code I rode
function quit() {
$customer['parcelas'] = $customer['parcelas'] - 1;
update('customers', $id, $customer);
however, when I call the onclick function it simply does nothing, what’s wrong with the code?
update: I tried another type of code but it also didn’t work:
function quit() {
$sql ="UPDATE customers SET parcelas='" . $customer['parcelas'] ."'";
}
I used this function in conjunction with a variable in session with the id to be able to set Where also however it does not work, I gave a var_dump to see if the variable was correctly set and was normally, but the code was still not working
– FelipeSilva
What is the result of the "dump" of the mounted $sql? Ex: var_dump($sql);
– Otavio Nogueira
hi, sorry for the delay, it gives a string, does not give an int
– FelipeSilva
Hello, to help you, I need more details. "doesn’t work" is quite broad. Put your quit() function in full as it is today. In your example you only have the $sql variable but without running the command in the database.
– Otavio Nogueira