Guest User

Untitled

a guest
Oct 26th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?php
  2. $pubname=$_POST["pname"];
  3. $servername = "localhost";
  4. $username = "root";
  5. $password = "jit123";
  6. $dbname = "1jt14cs019db4";
  7.  
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9.  
  10. if ($conn->connect_error)
  11. {
  12.         die("connection failed: " . $conn->connect_error);
  13. }
  14. else
  15. {
  16.        
  17.         $sqlQuery = "update catalog set price=price+price*0.1 where publisher_id in(select publisher_id from publisher where pname='$pubname')";
  18.        
  19.         $result = $conn->query($sqlQuery);
  20.      
  21.         }
  22.        
  23.        
  24.  
  25.  
  26.        
  27.        
  28. echo $pubname;     
  29.        
  30. $conn->close();
  31. ?>
Add Comment
Please, Sign In to add comment