How to get records from two tables with multiple where conditions
<p>I have a two tables one is Userregistration and second is user_verificationcode from which i have to get only those record whose email and mobile status are 1.Below are my table structure</p>

<p>Userregistration table</p>

<pre><code>........................................
id      fullname   mobile_no       email
.........................................
5      varun         12344567   abc@gmail
6      nitin         12345678   def@gmail
</code></pre>

<p>user_verificationcode</p>

<pre><code>.............................................
id      user_id     codetype      status
............................................
1       5            email           0  
2       5            mobile          1
3       6            email           1  
4       6            mobile          1
</code></pre>

<p>I want this kind of output </p>

<pre><code>........................................
id      fullname   mobile_no       email
.........................................
6       nitin         12345678   def@gmail
</code></pre>

<p>For this i have used below query but its not working i am not getting how to achieve this.</p>

<pre><code>SELECT * FROM Userregistration 
INNER JOIN user_verificationcode ON Userregistration.`id`=user_verificationcode.`user_id` 
where user_verificationcode.`codetype`='email' 
and user_verificationcode.`status`='1' 
and user_verificationcode.`codetype`='mobile' 
and user_verificationcode.`status`='1'
</code></pre>