title: Need proper Query for database
body: <p>I need a little help in writing a proper query. Here is the scenario...</p>
  
  <p>I am implementing some auto suggestions to an input field. I had this query for simple suggestions.</p>
  
  <pre><code>$temp = $this-&gt;db
      -&gt;select('state as label, state as value')
      -&gt;where('last_name !="" AND state LIKE ', $term.'%' )
      -&gt;get('user_profile')
      -&gt;result_array();
  </code></pre>
  
  <p>This query works perfectly for me. But the problem is that this query brings up the results from only one column which is the state column. Now what I need is that I want to fetch results which match up any of the three columns there. the query I am writing now is</p>
  
  <pre><code>$temp = $this-&gt;db
      -&gt;select('zip as label, zip as value')
      -&gt;where(
          'last_name !="" 
          AND zip LIKE ', $term.'% 
          OR suburb LIKE ', $term.'% 
          OR city LIKE ', $term.'%' )
      -&gt;get('user_profile')
      -&gt;result_array();
  </code></pre>
  
  <p>This query is not being executed at all. There must be a syntax error somewhere which I am not able to identify...I want that the results that match up the criteria i show them in the following form.</p>
  
  <p>zip, suburb, city</p>
  
  <p>Previous query just brings up the results from one column and I display it as it is. Now i need to bring up results from 3 columns and need to show them as they are.</p>
  
  <p>Any help would be highly appreciated.</p>
  
  <p>Thanks.</p>