I'm trying to recode to work it with PHP7 but failing miserably. Could someone point me to the right direction?
Here's the error:
Warning: mysqli_query() expects at least 2 parameters, 1 given in /Applications/XAMPP/xamppfiles/htdocs/students/index.php on line 55
Fatal error: Uncaught Error: Call to undefined function mysql_fetch_array() in /Applications/XAMPP/xamppfiles/htdocs/students/index.php:57 Stack trace: #0 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/students/index.php on line 57
PHP Code:
<?php
include("db.php");
$result=mysqli_query("SELECT * FROM students");
while($test = mysql_fetch_array($result))
{
$id = $test['UID'];
echo "<tr align='center'>";
echo"<td><font color='black'>" .$test['UID']."</font></td>";
echo"<td><font color='black'>" .$test['FirstName']."</font></td>";
echo"<td><font color='black'>". $test['LastName']. "</font></td>";
echo"<td><font color='black'>". $test['Marks']. "</font></td>";
echo"<td><font color='black'>". $test['RollNumber']. "</font></td>";
echo"<td> <a href ='view.php?UID=$id'>Edit</a>";
echo"<td> <a href ='del.php?UID=$id'><center>Delete</center></a>";
echo "</tr>";
}
mysql_close($conn);
?>
I have removed other unnecessary code and showing only the one which is creating error.