Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. function conectar(){
  4. // Create connection
  5. $dbhost = "localhost";
  6. $dbuser = "root";
  7. $dbpass = "";
  8. $dbname = "bd_preparatoria";
  9. $conexion = mysqli_connect($dbhost, $dbuser, $dbpass);
  10. //if (!$conexion) {
  11. //echo 'Error al conectar a la base de datos';
  12. //}
  13. //else {
  14. //echo 'Conectado a la base de datos';
  15. //}
  16. mysqli_select_db($dbname,$conexion);
  17. return $conexion;
  18. mysqli_query("SET NAMES utf8");
  19. mysqli_query("SET CHARACTER_SET utf");
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement