codeigniter mysql bitwise operator

codeigniter mysql bitwise operator

I have a value in my database (int) decimal. I have several constants in my codeigniter application linked to a binary 1 - 2 - 4 - 8 - ... .

I have a value in my database (int) decimal. I have several constants in my codeigniter application linked to a binary 1 - 2 - 4 - 8 - ... .

I wanted to get all users with a specific binary acces level to be shown.

public function query($level = 0)
{
    $data = NULL;

$this->db->select('user_id, user_email, user_name, user_firstname, user_imageammount, user_auth');
$this->db->from('users');
$this->db->where('user_auth' & $level);

$query = $this->db->get();

if ( $query->num_rows() > 0 )
{
    $data = $query->result_array();
}

return $data;

}

When i run the query straight in my phpmyadmin i get the results that i need.

SELECT user_id, user_email, user_name, user_firstname, user_imageammount, user_auth FROM users WHERE user_auth & 1

When i run it in codeigniter i get a error.

Severity: Warning Message: A non-numeric value encountered

Any help or advice would be appriciated.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

PhP MySQL Projects

Simpliv LLC, a platform for learning and teaching online courses. We basically focus on online learning which helps to learn business concepts, software technology to develop personal and professional goals through video library by recognized industry experts and trainers.

The Complete PHP MySQL Professional Course with 5 Projects

The Complete PHP MySQL Professional Course with 5 Projects

PHP Interview Questions with Solutions: Prepare for PHP Interview

Prepare for PHP Interviews. Set Variable With php.ini File. Logic & Output Behind PHP Code Segment. Class Concept, Error & Functions in PHP. Start PHP Now!