Search Operators

The get method generic features of the search operators.

Here's how to use some search operators on the get () method;


#allows you to view all the queries 
$this->collector['points']->debug = true; 

$previous = $this->collector['points']->get( 
array( 
'remote_addr' => $_SERVER['REMOTE_ADDR'] 
,'>created_at' => date("Y-m-d H:i:s", time()-3600) 
) 
); 


Here's the SQL query associated : 




SELECT id_points, lat, lng, remote_addr, created_at FROM gen_points WHERE 1=1 AND remote_addr = '80.119.202.145' AND created_at > '2019-10-11 11:17:28' 



Here the search operator ">" in front of the name of the field "created_at" is the search operator. Here is the list of available operators :


> 
<
<=
>= 
!= 
LIKE> 
!LIKE> 


It is also possible to search for type SELECT....WHERE .... IN or NOT INT : # search IN()

$previous = $this->collector['points']->get( 
array( 
'id_points' => array(1,2,3) 
) 
); 
# research NOT IN() 
$previous = $this->collector['points']->get( 
array( 
'!id_points' => array(4,5,6) 
) 
);