Magento Accessing an External Database from Module

I followed a tutorial on inserting data in an external db using a Magento Module. The tutorial located here – http://www.divisionlab.com/solvingmagento/accessing-an-external-database-from-your-magento-module/

I’m trying to:

  1. Figure out how to trim the spaces in the email address. I can’t figure out how to do this.
  2. How to specify which time zone to insert. I added that code but doesn’t seem to be working.

Here’s the code so far:

      $externalDataWrite = Mage::getModel('externaldb/externaldata');
      $externalDataWrite->setUser_email($email);
      $externalDataWrite->date_default_timezone_set('America/Chicago');
      $externalDataWrite->setUser_registered(date('Y-m-d H:i:s'));

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s