I have a module that observes the status and writes a value into the database.
When the product is simple, it works. But when it is configurable, it writes the value of the Pattern Product and not of the Child.

```
if (($status !== $previousStatus) && ($status == Mage_Sales_Model_Order::STATE_PROCESSING)) {
  $order = $observer->getEvent()->getOrder();
  $items = $order->getAllVisibleItems();
  mysql_connect('localhost', 'user', 'pass');
  foreach($items as $item){
    $cd = $item->getProduct()->getData('cd');
    mysql_query("INSERT INTO `bd`.`table` (`id`, `cd`) VALUES (NULL, '$cd')");
  }
  return true;
}

```

How to identify if it is a configurable product, and get data from the child product?