I need to make an sql sentence where i retrieve records filtered by 'scope' value from core_config_data table. This is the script:
$query = "SELECT * FROM `core_config_data` WHERE `scope` = $scope";
I get $scope with this line:
$scope = Mage::getSingleton('adminhtml/config_data')->getScope();
But when i run this, i receive an error saying:
An error occurred while saving this configuration: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'stores' in 'where clause'
When i run the same sql sentence in phpmyadmin, it works fine and it retrieves the correct record, so i don't know what's wrong here.
Thanks for helping