I'm using Zeos and Lazarus to access a mySql database on the cloud.
This is the code I wrote:
Code: Select all
ZQuery3.SQL.Text:= 'UPDATE 2_banco SET confere="A" , nome = "'+vnome+'", cpftel = "'+ vCpf +'", dia = "'+dia+'", hora = "'+hora+'" where codEntrev = ' + vTexto +' and cpftel is null';
try
ZQuery3.ExecSQL;
except
On E:Exception do
controle :=1;
end;
if controle <> 1
then
begin
if Zquery3.RowsAffected > 0 then
Zquery3.
begin
Memo1.Lines.Add(vTexto+vcspro+vcspro1);
ZQuery9.SQL.Text:= 'INSERT INTO 2_lista_reserva (cpf, idoso, dia, hora, gravacao) VALUES ("'+ vCpf+'", "'+ vtexto +'", "'+dia+'", "'+hora+'", "M")' ;
try
ZQuery9.ExecSQL;
except
On E:Exception do
controle :=0;
end;
end;
endelse
begin
...
end;
Code: Select all
if Zquery3.RowsAffected > 0 then
Do you know why that happened? Am I missing something?
Any insight would be apreciated.