Advertisement
Guest User

Untitled

a guest
Jan 15th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "";
  5. $dbname = "pythonspot";
  6.  
  7. //function max(){
  8. // Create connection
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10. // Check connection
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. $sql1 = "SELECT MAX(ID) AS ID from vmercusuar where Sistem='Pulau Pongok' and Kondisi='DMP (MW)'";
  16. $result1 = $conn->query($sql1);
  17. //$x=1;
  18. if ($result1->num_rows > 0) {
  19. // output data of each row
  20. while($row1 = $result1->fetch_assoc()) {
  21.  
  22. $maxi = $row1["ID"];
  23. echo $maxi;
  24. }
  25. }
  26. $conn->close();
  27. //}
  28. //max();
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement