Jump to content


Photo

[HH#33064] Problema Mysql


  • Please log in to reply
21 replies to this topic

#16 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 16,396 posts
  • Gender:Male

Posted 18 January 2018 - 08:33 PM

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.



#17 ojedajvi

ojedajvi

    Rank I Member

  • Members
  • Pip
  • 10 posts

Posted 18 January 2018 - 08:39 PM

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, 18 January 2018 - 09:24 PM.
removed password


#18 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 16,396 posts
  • Gender:Male

Posted 18 January 2018 - 09:24 PM

What error do you get with mysqli?

#19 ojedajvi

ojedajvi

    Rank I Member

  • Members
  • Pip
  • 10 posts

Posted 18 January 2018 - 09:26 PM

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



#20 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 16,396 posts
  • Gender:Male

Posted 18 January 2018 - 09:28 PM

You're not using mysqli then. That error means you're still using mysql_connect()...

#21 ojedajvi

ojedajvi

    Rank I Member

  • Members
  • Pip
  • 10 posts

Posted 18 January 2018 - 09:29 PM

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, 18 January 2018 - 09:53 PM.
translated


#22 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 16,396 posts
  • Gender:Male

Posted 18 January 2018 - 09:56 PM

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);
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users