can someone please help me, i am trying to show different images based on the records i have for each user in my table ‘permissions’. i am using .
if the records dont exist in the table i want to include a different file path i.e.
At the moment it brings up results if the users permission is set to 1 or 0 but i want to make it so that if no results are found in the table it shows something as a default.
code:
<?php if (logged_in()) {
$account_perms = account_perms();
while ($perms = mysql_fetch_array($account_perms)) {
if ($perms['privellages'] == '1') {
if ( mysql_num_rows( $perms ) > 0 )
include('includes/mod_profile/mod_photos/private.php');
}
}
$account_perms = account_perms();
while ($perms = mysql_fetch_array($account_perms)) {
if ($perms['privellages'] == '0') {
include('includes/mod_profile/mod_photos/private2.php');
}
}
$account_perms = account_perms();
while ($perms = mysql_fetch_array($account_perms)) {
if($perms->num_rows > 0) {
include('includes/mod_profile/mod_photos/private2.php');
}
}
} ?>
Try this: