Re: [PHP-DB] SELECT online store discount %

2011-08-22 Thread Ron Piggott
A variety of if’s and Greatest in conjunction to mySQL math works! SELECT ( ( GREATEST( IF( ( SELECT 10 AS discount FROM `paypal_payment_info_sample` WHERE `datecreation` >= DATE_SUB( NOW( ) , INTERVAL 4 MONTH ) AND `buyer_email` = '$client_email' AND `paymentstatus` = 'Completed' LIMIT 1 ) , 10

Re: [PHP-DB] SELECT online store discount %

2011-08-22 Thread Amit Tandon
Ron Have u thought of CASE (in SELECT). Remebber their is some syntactical difference in "CASE" for SELECT and "CASE" in procedures regds amit "The difference between fiction and reality? Fiction has to make sense."