Guest User

Untitled

a guest
May 29th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php
  2. $host= "localhost";
  3. $dbUser= "usuario";
  4. $userPass = "pass";
  5. $dbName = "baseDatos";
  6. $conexion=mysqli_connect($host,$dbUser,$userPass,$dbName);
  7. // Check connection
  8. if (mysqli_connect_errno())
  9. {
  10. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  11. }
  12.  
  13. // Perform queries
  14. $sql = "SELECT * FROM Personas";
  15. $resultado = mysqli_query($conexion,$sql);
  16. echo mysqli_num_rows($result);
  17.  
  18. mysqli_close($con);
  19. ?>
Add Comment
Please, Sign In to add comment