Olá, Formulário mestre único registro e detalhes grid editável(view),
Crie um evento PHP
atualizar_totais1
sc_lookup(dataset,“SELECT SUM(valor_investido)
FROM investimentos
WHERE cod_investidor = ‘{codigo}’”);
$total_invest ={dataset}[0][0];
sc_format_num($total_invest, ‘.’, ‘,’, 2, ‘S’, ‘1’, ‘’);
sc_master_value(‘total_investido’, $total_invest);
sc_exec_sql(“UPDATE investidores
SET total_investido = $total_invest
WHERE codigo = {cod_investidor}”);
No eventos
Incluir\modificar\Excluir
atualizar_totais1();
Ao tentar fazer modificação mensagem de erro na tabela detalhes:
Erro ao acessar o banco de dados
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE codigo = 2’ at line 1
Alguém já passou por isso,
Obrigado,
Leão