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->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.

php mysql codeigniter

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Best MySQL DigitalOcean Performance – ScaleGrid vs. DigitalOcean Managed Databases

Compare ScaleGrid MySQL vs. DigitalOcean Managed Databases - See which offers the best MySQL throughput, latency, and pricing on DigitalOcean across workloads.

Category Subcategory Dropdown in PHP MySQL Ajax

PHP mysql dynamic dropdown list onchange. Here, we'll show how to populate category and subcategory in dropdown list using ajax in PHP mysql

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.

PHP MySQL Tutorial - User Registration System Using PHP & MySQL

In this PHP MySQL Tutorial, you'll learn how to create a user registration and login system using PHP and a MySQL database.

Hire CodeIgniter Developer

Want to create unique, scalable web and app solutions? At **[]( "")**, Expert CodeIgniter developer works particularly for you and your project. You can **[Hire CodeIgniter...