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

Error

Opened this issue · 3 comments

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

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

Same here

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_connect_error();
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'];
...
}