Krydos Posted January 18, 2018 Posted January 18, 2018 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.
ojedajvi Posted January 18, 2018 Posted January 18, 2018 (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 January 18, 2018 by Krydos removed password
ojedajvi Posted January 18, 2018 Posted January 18, 2018 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
Krydos Posted January 18, 2018 Posted January 18, 2018 You're not using mysqli then. That error means you're still using mysql_connect()...
ojedajvi Posted January 18, 2018 Posted January 18, 2018 (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 January 18, 2018 by Krydos translated
Krydos Posted January 18, 2018 Posted January 18, 2018 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); ?>
Recommended Posts