Question: I want to decrement a database table value if the field value is greater than or equal to 1 (`>= 1`). Otherwise (if it IS less than 1) then I want to delete that whole database record, My code decrements the value continuously but does not delete the record when it reaches less than 1.

I think the `$Check` variable does not hold the `Quantity` field value but I'm not sure:

Using MySQL

Here is my code:

```
$Check = "SELECT Quantity FROM Cart WHERE ItemCode = '1'";

if($Check >= '1')
{
    $Query = "UPDATE Cart SET Quantity = Quantity - 1 WHERE ItemCode = '1'";
    mysql_query($Query);
}
else
{
    $DeleteRow = "DELETE FROM Cart WHERE ItemCode = '1'";   
    mysql_query($DeleteRow);
}

mysql_close();

```

Answer: 
If you're running under iOS 6 then `shouldAutorotateToInterfaceOrientation` has been deprecated. You should use `supportedInterfaceOrientationsForWindow:` and `shouldAutorotate` methods.

Have a look at the iOS 6 release notes [here](https://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/index.html) under the UIKit heading.
It's `supportedInterfaceOrientations` on `UIViewController` you want to implement for iOS6 rather than `shouldAutorotateToInterfaceOrientation`.