Buongiorno a tutti.
Abbiamo creato un database SQL e con la funzione Select where andiamo a recuperare dei dati che vengono stampati a video in base a delle richieste via form.

Lo script funziona egregiamente ma ci manca di inserire sempre in base alle stesse condizioni la funzione somma dei "punti" raggiunti.

Come dobbiamo fare?

ECCO IL FORM:
Codice PHP:

<form action="prova_select_1.php" method="post">
<
div align="center">

  <
table width="900" border="0">
    <
tr>
      <
th scope="col"><div align="left">[url="#regolamento"][img]/button_regolamento.png[/img][/url][url="#premi"][img]/lista_regali.png[/img][/url][url="/aziende-fidelity-card.php"][img]/aziende_fidelity.png[/img][/url]</div></th>
    </
tr>
  </
table>
</
div>
  <
div align="center">
    <
table width="902" border="0" background="back_fidelity.png" repeat="norepeat">
      <
tr>
        <
th scope="col">

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
        

</
p></th>
        <
th scope="col">

</
p>
          

</
p>
        

</
p></th>
        <
th scope="col"></th>
        <
th width="469" rowspan="10" scope="col">

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
        

</
p></th>
      </
tr>
      <
tr>
        <
th scope="col"></th>
        <
th scope="col"></th>
        <
th scope="col"></th>
      </
tr>
      <
tr>
        <
th width="33" height="83" scope="col"></th>
        <
th width="183" scope="col"><div align="left">[b]CODE:[/b]</div></th>
        <
th width="192" scope="col"> <div align="center">
          <
input type="text" name="CODE" />
        </
div></th>
      </
tr>
      <
tr>
        <
td height="110"></td>
        <
td></td>
        <
td><div align="center">
          


            <
input type="submit" />
            </
p>
          

</
p>
          

</
p>
          

</
p>
          

</
p>
        </
div></td>
      </
tr>
    </
table>
  </
div>
</
form
ECCO IL FILE PHP
Codice PHP:
<?php
$con 
mysql_connect("localhost","XXXXXXX","XXXXX");
if (!
$con)
{
die(
'Could not connect: ' mysql_error());
}
$result mysql_query("SELECT * FROM 'fidelity_tb' WHERE CODE = '" $_POST['CODE'] ."'");print_r($result);
while(
$row mysql_fetch_array($result))

 {
 echo 
$row['CODE'] . " " $row['NOME'];
 echo 
"
"
;
 }
?>
SOTTO A QUESTO DOVREI METTERE IL TOTALE DELLA CASELLA PUNTI DI QUESTO CLIENTE.
IL FORM LO TROVATE ALL'INDIRIZZO http://www.hoteltrivigno.com/fidelity-card.php
a voi un codice da provare 45657


grazie in anticipo
Raffaele