MySQL error #1054 unknown column in field
<p>This is my query:</p>

<pre><code>SELECT COUNT( DISTINCT (paypal_transaction.buyerId) ) AS cid FROM eg_posts_details
INNER JOIN paypal_transaction ON paypal_transaction.id =  eg_posts_details.OrderId
WHERE seller_id =190
</code></pre>

<p>It runs perfectly on MySQL directly but when I run it from my PHP codeigniter model I get the #1054 error. I have no idea why this is happening. Please help.</p>

<p>Here is the PHP code:</p>

<pre><code> $query = $this-&gt;db-&gt;query("SELECT COUNT( DISTINCT (paypal_transaction.buyerId) ) AS cid 
FROM eg_posts_details 
INNER JOIN paypal_transaction ON paypal_transaction.id =  eg_posts_details.OrderId 
WHERE seller_id =190");
</code></pre>