SHARE
TWEET

Untitled

a guest Sep 6th, 2019 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.         $con=mysqli_connect("localhost","root","","database");
  3. // kontrollime ühendust databaasiga
  4. if (mysqli_connect_errno())
  5.   {
  6.   echo "Ei saanud ühenudust: " . mysqli_connect_error();
  7.   }
  8.  
  9. $sql="SELECT * FROM users ";
  10.  
  11. if ($result=mysqli_query($con,$sql))
  12.   {
  13.   // toome andmed nähtavale lehele
  14.   while ($row=mysqli_fetch_row($result))
  15.     {
  16.     printf ("%s (%s)\n",$row[0],$row[1]);
  17.     }
  18.   // Free result set
  19.   mysqli_free_result($result);
  20. }
  21.  
  22. mysqli_close($con);
  23. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top