Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Search: Do vs Query

Quote Reply
Search: Do vs Query
Alex,

I need to pass in a query like:

Code:
SELECT * FROM Table WHERE (SendDate<=Current_date()) AND (Sent!='True');

Can I pass that through a $db->query or do I have to use a '$db->do' construct?
Quote Reply
Re: Search: Do vs Query In reply to
Ok,

I think I get it... I can send a test along with the 'value' parameter in the hash. The 'value' is evaluated for operators before it's inserted into the 'key' request.

Quote Reply
Re: Search: Do vs Query In reply to
If you are using query, you can't use Current_Date() (do you mean NOW()?). Also, you can't do a not equal, however if the values are true or false you could do:

$today = $db->get_date();
$hits = $db->query ( { SendDate => "<$today", Sent => 'False', ww => 1 } );

which should work.

Hope that helps,

Alex