Sunday, 8 September 2013

Include file generate warning

Include file generate warning

I have an INCLUDE file to manage user permissions (include/permission.php)
// PERM
$result = mysql_query("SELECT * FROM mod_permission WHERE
usuer_id=".$_SESSION['user_id']);
$row = mysql_fetch_array($result, MYSQL_BOTH) or die(mysql_error());
$perm_add = $row['perm_add'];
$perm_edit = $row['perm_edit'];
$perm_del = $row['perm_del'];
But when i try to include i have error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean
given in
I'm like to make something this:
File: example.php
<?php
include_once "include/db_conn.php";
include_once "include/permission.php";
if ($perm_add != "1") {
header("Location: $url/dash.php?error=1"); exit;
}
?>
Where do I wrong? Thanks ALL for helping!!!

No comments:

Post a Comment