I'm developing a little web where I use some permissions through a MySql database. This permissions are like this:
read: 1, write: 0, delete: 0
Where 1 is that the user has the permission, and 0 is that the user hasn't it.
Well, the code and query for get this permission are these:
$perms = $bd->exec("select for_read, for_write, for_delete from perms where my_type = :type;",
array(
':type' => $_SESSION['myuserdata']['type']
)
);
This code works fine in my local environment (for development), as with this code I can get the correct permissions; but when i put this code into my production server, the query result is empty (the var_dump always show the fields like ''); weirdest thing is that when I execute the query directly into phpmyadmin, yes I can get the correct permissions.
If I apply a var_dump to the result, the response is like this:
array(3) { ["writeperm"]=> string(1) "" ["readperm"]=> string(1) "" ["deleteperm"]=> string(1) "" }
This is very strange because the items says string (1)
, but these don't have value.
Somebody have any idea to solve this issue? Or Why is happening?
Regards from Mexico.