Prosen-Ghosh / School-Management-System-With-PHP

29 stars 42 forks source link

Error #4

Open Karla02 opened 6 years ago

Karla02 commented 6 years ago

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\School-Management-System-With-PHP-master\service\mysqlcon.php:7 Stack trace: #0 C:\xampp\htdocs\School-Management-System-With-PHP-master\service\check.access.php(2): include_once() #1 {main} thrown in C:\xampp\htdocs\School-Management-System-With-PHP-master\service\mysqlcon.php on line 7

ekreddy commented 5 years ago

I am also getting same error .. Any help here ?

hassam5 commented 4 years ago

Same here

Majidkadi commented 2 years ago

Hi Every one,

You have to update to mysqli like this: $conn=mysqli_connect($db_host, $db_username, $db_password, $db_name); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connecterror(); exit(); } And you need to change all mysql in the whoul project to mysqli_(lots of work):

You also should use this for example to get all students:

$sql = " SELECT * FROM students Where id='$yourId';"

$resulte = mysqli_query($conn, $sql);

while($row = mysqli_fetch_array($result)) { echo "$row['id']; echo "$row['name']; echo "$row['email']; ... }