Error al iniciar sesión

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /storage/ssd5/610/2355610/public_html/conexion.php:6 Stack trace: #0 /storage/ssd5/610/2355610/public_html/login.php(3): require_once() #1 {main} thrown in /storage/ssd5/610/2355610/public_html/conexion.php on line 6

Hi @rootvanjalen!

Please lower your PHP version and try again: 000webhost cPanel > Settings > General > Change PHP version > 5.6

1 Like

you ar the best, thanks a lot! now i have this problem Warning: mysql_connect(): Connection refused in /storage/ssd5/610/2355610/public_html/conexion.php on line 6

This means your database credentials are incorrect.

Please check the database credentials from conexion.php and make sure they are the same with the ones from 000webhost cPanel > Manage databases

well i check my credentials now are correct

Warning: mysql_select_db() expects parameter 2 to be resource, string given in /storage/ssd5/610/2355610/public_html/conexion.php on line 7

This means there are issues in your PHP scripts…

Please check the documentation for mysql_select_db() on php.net

Also, I suggest you to code your website using mysqli_* functions set instead, as the mysql_* one is deprecated and is no longer supported in the later PHP versions.

i dont find the error
this is mi php.net

<?php

$host="localhost";
$user="id2355610_root";
$pass="123456";
$base="id2355610_pagina";

$conexion= mysql_connect ("$host","$user","$pass") or die ('No se pudo conectar');

mysql_select_db ("$base","$conexion") or die ('La base de datos no existe');

?>

Try this instead…

<?php

$host="localhost";
$user="id2355610_root";
$pass="123456";
$base="id2355610_pagina";

$conexion = mysql_connect($host, $user, $pass) or die ('No se pudo conectar');

mysql_select_db($base, $conexion) or die ('La base de datos no existe');

?>
1 Like

men you are a genius !!!

I am glad I could help :blush: