Problema apara conectar base de datos


#1

Hola en mi localhost de mi pc funciona todo correcto pero al subir mi pagina no conecta con la base de datos
este es mi código de conección:

<?php if (!isset($_SESSION)) {
  session_start();
}?>
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_conexion = "localhost";
$database_conexion = "id5091632_damas";
$username_conexion = "id5091632_root";
$password_conexion = "";
$conexion = mysql_pconnect($hostname_conexion, $username_conexion, $password_conexion) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

en esta imagen se puede ver los datos de la base de datos
image
ayudenme porfavor…


#2

Hi, your code looks fine to me, but I don’t know much about PHP. @ckhawand, can you take a look at this?


#3

mysql has been deprecated as of PHP 7.
2 solutions:

  • Downgrade PHP version to 5.6 (Settings>General)
  • Use mysqli instead (more secure)

#4

Thank you very much, I changed the php version and it worked


#5

Let us know if you’ve any other issue :slight_smile:


#6