Advertisement
Guest User

Untitled

a guest
Mar 28th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. $servername = "localhost";
  2. $username = "root";
  3. $password = "";
  4. $dbname="lamp";
  5.  
  6. $conn = new mysqli($servername,$username,$password,$dbname);
  7. if ($conn->connect_error)
  8. {
  9. die("Connection failed: " . $conn->connect_error);
  10. }
  11. $contactno=mysqli_real_escape_string($conn,$_POST['contactno']);
  12. $description=mysqli_real_escape_string($conn,$_POST['description']);
  13. $email=mysqli_real_escape_string($conn,$_POST['contactemail']);
  14.  
  15. $subject=mysqli_real_escape_string($conn,$_POST['subject']);
  16. $creationdate=mysqli_real_escape_string($conn,$_POST['creationdate']);
  17. if(isset($_POST['status1']))
  18. {
  19. $status =$_POST['status1'];
  20. }
  21. if(isset($_POST['noteid']))
  22. {
  23. $id = mysqli_real_escape_string($conn,$_POST['noteid']);
  24. }
  25.  
  26. $stmt=$conn->prepare("update notifications set subject=?,description=?
  27. ,status=?, creationdate=?,contactno=?,contactemail=? where id=? ");
  28. $stmt->bind_param("ssisisi",$subject,$description,$status,$creationdate,$contactno,$email,$id);
  29. $stmt->execute();
  30. $stmt->store_result();
  31. if($stmt->num_rows >0)
  32. {
  33. echo "sucess";
  34. header("Location: updategovermentnotification.php");
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement