Advertisement
TenshiNoKioku

php

Jan 19th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. <?php
  2.    $dbhost = '*****';
  3.    $dbuser = '***';
  4.    $dbpass = '****';
  5.    $dbname = '*****;
  6.   $conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname);
  7.  
  8.   if(! $conn ) {
  9.      die('Could not connect: ' . mysqli_error());
  10.   }
  11.   echo 'Connessione avvenuta con successo<br>';
  12.  
  13.  
  14.   if(isset($_POST['Submit1'])) {
  15.   // รจ stato premuto il primo pulsante
  16.  
  17.   $valorepresente= "SELECT AffittoGennaio FROM PomeziaCosti";
  18.   mysqli_query($conn, $valorepresente);
  19.      echo("$valorepresente");
  20.      
  21.   $valoreDaSommare = $_POST['affittogennaio'];
  22.      
  23.   $valoreDaPassare = $valorepresente + $NuovoValoreAffitto;
  24.      
  25.      
  26.      
  27.   $querydiupdate = "UPDATE PomeziaCosti SET AffittoGennaio ='$valoreDaPassare' ";
  28.   mysqli_query($conn, $querydiupdate);  
  29.      
  30.     /*  if (mysqli_query($conn, $sql)) {
  31.      echo "Record updated successfully";
  32.   } else {
  33.      echo "Error updating record: " . mysqli_error($conn);
  34.   } */
  35.  
  36.  
  37. }
  38.  
  39.  
  40.  
  41.   mysqli_close($conn);
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement