誰かが私を助けてくれますか、私は私のテーブルの「許可」の各ユーザーのために私が持っている記録に基づいて異なる画像を表示しようとしています。使ってます 。
レコードがテーブルに存在しない場合は、別のファイルパスを含めたいです。
現時点では、ユーザー権限が1または0に設定されている場合に結果が表示されますが、テーブルに結果が見つからない場合はデフォルトとして何かが表示されるようにしたいと思います。
コード:
<?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');
}
}
} ?>