Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Fatal error: Uncaught Error: Call to undefined function mysql_connect()?

how to fix this?
(I just started using the platform, please do not report.)

error;

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\myproject\assets\connection.php:8 Stack trace: #0 C:\xampp\htdocs\myproject\login.php(3): require_once() #1 {main} thrown in C:\xampp\htdocs\myproject\assets\connection.php on line 8

my login.php

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<?php

require_once 'assets/connection.php';
session_start();

?>

my connection.php

<?php

$host = "localhost";
$username = "root";
$pass = "";
$database = "testbase";

$connection = @ mysql_connect($host,$username,$pass,$database) or die("MySql  Yöneticiyle iletişime geçin.");
mysql_select_db($database, $connection) or die("MySql Bağlantısı öneticiyle İletişime geçin.");

?>

>Solution :

The mysql_connect function has been discontinued in the PHP 7.

Use mysqli_connect()

How can create query with mysqli:

$link = mysqli_connect("host", "user", "pass", "database");
mysqli_query($link, $query);

You use PHP 7, correct?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading