Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error: SQLSTATE[HY000] [2002] No such file or directory
- Error al conectar a la base de datos. SQLSTATE[HY000] [2002] No such file or
- directory
- <?php
- $DB_host="localhost";
- $DB_user="root";
- $DB_pass="pass";
- $DB_name="aviwebco_supera_tu_crisis";
- try {
- $DB_con = new PDO("mysql:host={$DB_host};dbname={$DB_name}", $DB_user,$DB_pass);
- $DB_con->exec("SET CHARACTER SET utf8");
- $DB_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- } catch (PDOException $e) {
- print "¡Error!: " . $e->getMessage() . "<br/>";
- echo "Error al conectar a la base de datos. " . $e->getMessage() . "<br/>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement