Re: SQL syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SELECT orderid
                FROM 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@xxxxxxxxxxxxxxx>wrote:

> SELECT orderid
>                 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)."')";
>



============
regds
amit

"The difference between fiction and reality? Fiction has to make sense."

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux