<?php
$student_info = getAllRows('student');
$counter = 1;
foreach ($student_info as $key => $student) {
?>
<tr>
<td><?php echo $student['email']; ?></td>
<td>
<?php
if (isset($student['image']) && !empty($student['image']) && file_exists(UPLOAD_DIR.'student/'.$student['image'])) {
echo "<img src='upload/student/".$student_info['image']."' class='img img-responsive img-thumbnail' width='300px'> ";
}else{
echo "<img src='upload/logo.png' class='img img-responsive img-thumbnail' width='300px'> ";
}
?>
</td>
<td><a href="addaccount.php?id=<?php echo $student['id'] ?>&act=edit">edit</a>/<a href="account.php?id=<?php echo $student['id'] ?>&act=delete" onclick="return confirm('Are You sure you want to delete this student Account?');">delete</a>/<a href="change_password.php?id=<?php echo $student['id'] ?>&act=change_password">Change Password</a></td>
</tr>
I have use this code... but showing some error
error:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\school\admin\view_student_profile.php on line 58
I want to get data from db... and then show all the photo... there is more than one data in db... and also there is file in the source folder... my problem is that i wanna show related photo if present else a website logo