1
I am developing software in PHP/HTML/MYSQL FRONT. I need to update a table but change two columns at once. Here comes my doubt in the $gravaprat1 variable, because it is not executing the second command (SEND = 1). Follows:
$selectsql = "select osi, entrada, vendedor, prateleira, now(), abs(DATEDIFF(now(), str_to_date(entrada,'%Y-%m-%d'))) as dias from itens;";
$res = mysqli_query($conn, $selectsql);
$gravaprat1 = "update itens set prateleira = 1 where abs(DATEDIFF(now(), str_to_date(entrada,'%Y-%m-%d'))) < 30 ***(NESSA PARTE ESTOU COM DUVIDA -->)***and update itens set enviar = 1";
$prat1sql = mysqli_query($conn, $gravaprat1);
Thanks Matheus, it worked right.
– Otavio Faria
Oops, what a beauty then! Don’t forget to mark my answer as accepted if it really helped you, or any of the other answers!
– Matheus Ribeiro