Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2. $con = mysqli_connect("localhost","root","","latihan");
  3.  
  4. // Check connection
  5. if (mysqli_connect_errno())
  6. {
  7. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  8. }
  9.  
  10. $sql = "SELECT * FROM kriteria";
  11. $result = $con->query($sql);
  12.  
  13. if ($result) {
  14. while ($row = $result->fetch_row()) {
  15. echo "Kriteria dari ".$row[0]." adalah ".$row[1]."<br>";
  16. }
  17. $result->close();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement