I'm trying to delete some data from database with direct sql query, but I get a Cardinality violation.
$conn = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "DELETE * FROM catalog_product_super_link WHERE parent_id =" .
$_product->getId() . "AND product_id = ". $child_id . ";";
$conn->query($sql);
And the full error is:
SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s), query was: SELECT `catalog_product_entity`.* FROM `catalog_product_entity` WHERE (entity_id ='1', '3', '4', '5', '1431', '1432', '1433', '1434', '1435', '1436', '1437', '1438', '1439', '1440', '1441', '1442')
I'm not very good with sql queries... so I need a bit of help here
edit: catalog_product_super_link table
link_id - product_id - parent_id
1 1 2
2 3 2
3 4 2
4 5 2
5 6 7
6 8 7
7 9 7
8 10 7
9 11 7
10 12 7
11 13 7
15599 13 7182
12 14 7
15600 14 7182
13 15 7
14 16 7
15 17 7
16 18 7
17 19 7
18 20 7
19 21 7
20 22 7
21 23 24
22 25 24
23 26 24
24 27 24
25 28 24
26 29 24
27 30 24
... ... ...
catalog_product_super_link
table data?