John Davidson

php - notEqualTo in where cluase in zend

0 comments
Message:


I am trying to fetch all rows from mysql table where two column values are not equal in zend

So I tried using

where->notEqualTo('table.column1','table.column2')

but the rhs is being parsed as a value.

How can I fetch the rows with unequal values in two columns ?


Thanks in Advance



My Answer:
php
$select = $this->select()
->from('table_name')
->where('column1 <> column2');
$rows = $this->fetchAll($select);

Rate this post

5 of 5 based on 8306 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us