Re: SQL syntax
| From: | Karl DeSaulniers | Date: | Tue, 15 Jan 2013 12:41:19 +0000 |
| Subject: | Re: SQL syntax | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48643@lists.php.net to get a copy of this message | ||
On Jan 15, 2013, at 5:25 AM, Amit Tandon wrote:
SELECT orderidI am wanting Cancelled to be without a date check, but thanks for the suggestion. I will try the IN option. Thank you. Best, Karl DeSaulniers Design Drumm http://designdrumm.comFROM ORDERS_TABLE WHERE orderstatus IN ( 'Cancelled', 'New'", 'Denied', 'Expired' , 'Failed' , 'Pending' , 'Refunded' , 'Reversed' , 'Under Review', 'Voided') AND orderdate < '".mysqli_real_escape_string($ yesterday); Another option would be to use either of these functions - Find-in-set<http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set. This is useful if your data type is SET/ENUM type - Field<http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field On Tue, Jan 15, 2013 at 2:59 PM, Karl DeSaulniers <karl@designdrumm.comwrote:SELECT orderid============ regds amit "The difference between fiction and reality? Fiction has to make sense."FROM ORDERS_TABLE WHERE orderstatus = 'Cancelled' OR (orderstatus = ('New'OR 'Denied' OR 'Expired' OR 'Failed' OR 'Pending' OR 'Refunded' OR 'Reversed' OR 'Under Review' OR 'Voided') AND orderdate < '".mysqli_real_escape_string($**yesterday)."')";