Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "user";
  4. $password = "pass";
  5.  
  6. // Create connection
  7. $conn = mysqli_connect($servername, $username, $password);
  8.  
  9. // Check connection
  10. if (!$conn) {
  11. die("Connection failed: " . mysqli_connect_error());
  12. }
  13. echo "Connected successfully";
  14.  
  15. mysqli_select_db($conn, "commands");
  16.  
  17. $sql = "UPDATE module SET flag=0 WHERE node='0000' ";
  18.  
  19. if ($conn->query($sql) === TRUE) {
  20. echo "</br> Record updated successfully";
  21. } else {
  22. echo "</br> Error updating record: " . $conn->error;
  23. }
  24.  
  25.  
  26. $sql = "UPDATE cmd SET flag=0 WHERE command='capture' ";
  27.  
  28. if ($conn->query($sql) === TRUE) {
  29. echo "</br> Record updated successfully";
  30. } else {
  31. echo "</br> Error updating record: " . $conn->error;
  32. }
  33.  
  34.  
  35. $conn->close();
  36.  
  37. header("location: webcam.php");
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement