Jump to content

Recommended Posts

Posted

Uncaught Error: Call to undefined function mysql_connect()

mysql_connect doesn't exist in php 7.1. It's been deprecated for years in php 5. You need to use an older version of php (like 5.6) or use mysqli instead. I recommend mysqli.

Posted (edited)

but is that I do not know why I mark that error if I change the chain and attach my string again with mysqli

<?php
$con = mysqli_connect("localhost","ojedajvi_javier","<removed>","ojedajvi_alejandrotortoza");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?>
Edited by Krydos
removed password
Posted

el mismo error 

 

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/ojedajvi/public_html/admin/login/acceso_db.php:8 Stack trace: #0 /home/ojedajvi/public_html/admin/login/index.php(3): include() #1 {main} thrown in /home/ojedajvi/public_html/admin/login/acceso_db.php on line 8

Posted (edited)

claro que si aqui esta la cadena 

<?php
$con = mysqli_connect("localhost","ojedajvi_javier","CLAVE","ojedajvi_alejandrotortoza");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?>
translate.google.com:

 

Of course, if the chain is here

Edited by Krydos
translated
Posted

You post mysqli, but your file still has mysql_connect...?

 

/home/ojedajvi/public_html/admin/login/acceso_db.php:

 <?php
    $host_db = "localhost"; // Host de la BD
    $usuario_db = "ojedajvi_javier"; // Usuario de la BD
    $clave_db = "<removed>"; // Contraseña de la BD
    $nombre_db = "ojedajvi_alejandrotortoza"; // Nombre de la BD

    //conectamos y seleccionamos db
    mysql_connect($host_db, $usuario_db, $clave_db);
    mysql_select_db($nombre_db);
?>
Guest
This topic is now closed to further replies.
×
×
  • Create New...