• 0
Sign in to follow this  
Guest - Nilson -

Como Criar Uma Coluna Total

Question

Guest - Nilson -

Gostaria de saber como criar uma coluna que represente o total ou seja soma.

Tenho as seguintes colunas, teste1 teste2 teste3 como criar uma coluna na mesma tabela que represente a soma das três.

Até mais.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

antes de insserir os dados na tabela manda somar!

Share this post


Link to post
Share on other sites
  • 0

$var1 = 2;

$var2 = 3;

$var3 = 5;

$var_total = $var1+$var2+$var3;

mysql_query(INSERT INTO <tabela> (campo1,campo2,campo3,campo_total) values ($var1,$var2,$var3,$var_total));

e isso ai

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this