Value from MYSQL is coming null <p>I am fetching code from codeignitor using implode function. here is the code</p> <pre><code>$this-&gt;load-&gt;database(); $session_data = $this-&gt;session-&gt;userdata('logged_in'); $user_id = $session_data['user_id']; $this-&gt;db-&gt;select('skill_id'); $this-&gt;db-&gt;from('user_info_skillset'); $this-&gt;db-&gt;where('user_id',$user_id); $query = $this-&gt;db-&gt;get(); foreach($query-&gt;result() as $row) { $skill_id[] = $row-&gt;skill_id; } $test = implode(',',$skill_id); // echo '&lt;pre /&gt;'; // print_r($test); exit; $this-&gt;db-&gt;select('project_id'); $this-&gt;db-&gt;from('project'); $this-&gt;db-&gt;where_in('required_skills',$test); $query1 = $this-&gt;db-&gt;get(); echo '&lt;pre /&gt;'; print_r($query1); exit; return $query1-&gt;result(); </code></pre> <p>The problem is i can not able to fetch data for </p> <pre><code> echo '&lt;pre /&gt;'; print_r($query1); exit; return $query1-&gt;result(); </code></pre> <p>When i try enter this database query manually in mysql workbench it is working, but by code it displays null value. is that anything missing in code? please guide me. below is my output.</p> <p>Output</p> <pre><code>CI_DB_mysql_result Object ( [conn_id] =&gt; Resource id #34 [result_id] =&gt; Resource id #38 [result_array] =&gt; Array ( ) [result_object] =&gt; Array ( ) [custom_result_object] =&gt; Array ( ) [current_row] =&gt; 0 [num_rows] =&gt; 0 [row_data] =&gt; ) </code></pre>