ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Expression Engine + CodeIgniter -- Tips and Tricks to Get Started

December 31, 2009 3:40pm

Subscribe [20]
  • #16 / Jan 18, 2010 2:43pm

    BPeddle

    31 posts

    Vanquish ...

    Thanks for the write up very helpful.

    Are you using multiple database by chance when adding in CI to EE?  I have been trying to add in a MSSQL connection and did that in the database.php file

    $active_group = 'expressionengine';
    $active_record = TRUE;
    
    $db['expressionengine']['hostname'] = "<hostname>";
    $db['expressionengine']['username'] = "<username>";
    $db['expressionengine']['password'] = "";
    $db['expressionengine']['database'] = "<database>";
    $db['expressionengine']['dbdriver'] = "mysql";
    $db['expressionengine']['dbprefix'] = "exp_";
    $db['expressionengine']['pconnect'] = FALSE;
    $db['expressionengine']['swap_pre'] = "exp_";
    $db['expressionengine']['db_debug'] = TRUE;
    $db['expressionengine']['cache_on'] = FALSE;
    $db['expressionengine']['autoinit'] = FALSE;
    $db['expressionengine']['char_set'] = "utf8";
    $db['expressionengine']['dbcollat'] = "utf8_general_ci";
    $db['expressionengine']['cachedir'] = "<dir>";
    
    /* MSSQL */
    $db['default']['hostname'] = "<hostname>";
    $db['default']['username'] = "<username>";
    $db['default']['password'] = "";
    $db['default']['database'] = "<database>";
    $db['default']['dbdriver'] = "mssql";
    $db['default']['dbprefix'] = "";
    $db['default']['pconnect'] = TRUE;
    $db['default']['db_debug'] = TRUE;
    $db['default']['cache_on'] = FALSE;
    $db['default']['cachedir'] = "";
    $db['default']['char_set'] = "utf8";
    $db['default']['dbcollat'] = "utf8_general_ci";

    I set up a simple plugin to test with and tried many combinations but can’t see to get it working.

    $this->EE =& get_instance();
    $this->CI =& get_instance();

    I have included the EE because I need to:

    $parameter = $this->EE->TMPL->fetch_param('variable');

    When I try to connect to the second db I just get a blank screen

    $DB2 = $this->CI->load->database('default',TRUE);

    I just can seem to get the syntax right, either errors or blank.

  • #17 / Jan 18, 2010 7:13pm

    vanquish

    48 posts

    Are you using multiple database by chance when adding in CI to EE?  I have been trying to add in a MSSQL connection and did that in the database.php file

    Hi BPeddle, you shouldn’t normally be using multiple databases. 

    You can add your tables to the Expression Engine database.  The installer file of the module can be used to install the tables automatically, once you have programmed the create commands. This is what it is supposed to do. I recommend adding a prefix for your custom tables.  For example, my_project_ - Expression Engine will add its own prefix exp_ so it becomes exp_my_project_tablename

  • #18 / Jan 18, 2010 7:17pm

    BPeddle

    31 posts

    I have a MSSQL Database that has been in operation since 1998 that has millions of users and a massive amount of stored procedures.  Moving it to mysql in not even a remote option at this point.

    I can query directly from a plugin however I thought it would be nice to leverage CI as much as possible.

  • #19 / Jan 18, 2010 9:41pm

    vanquish

    48 posts

    I have a MSSQL Database that has been in operation since 1998 that has millions of users and a massive amount of stored procedures.  Moving it to mysql in not even a remote option at this point.

    I can query directly from a plugin however I thought it would be nice to leverage CI as much as possible.

    Wow!!  Well, in that case I would definitely recommend trying a multiple database structure.  Unfortunately I don’t have any experience in this area that I can help you with.

  • #20 / Jan 18, 2010 10:42pm

    BPeddle

    31 posts

    Your post was a great motivator today.  12 hours today and built some custom Plugins that will really streamline this app.

    Lots of head banging but once I gave up on the config/db stuff I started to crank.  Maybe another day I can go back to it.

    Thanks!

  • #21 / Feb 03, 2010 7:24pm

    fadedink

    3 posts

    Thanks for the write-up vanquish, it is a great starting point.

    Does anyone have any tips on form processing in EE v2? I have looked at the docs, but can’t figure out a way of making it as simple as form processing/validation in CI.

  • #22 / Feb 12, 2010 4:45am

    Gwarrior

    40 posts

    I’m also interested in more on form processing.

  • #23 / Feb 13, 2010 7:39am

    fadedink

    3 posts

    No-one seems to know how to do it yet, or at least they are not telling us 😊

    I have posted a question here, hopefully someone will come along with some extra info soon.

  • #24 / Mar 03, 2010 11:45am

    bryantAXS

    50 posts

    FYI—I submitted a UserVoice suggestion on this topic for their SXSW presentations and it got selected…

    If your heading to SXSW next week make sure to check this one out!

    http://ellislab.com/forums/viewthread/146732/

  • #25 / Mar 03, 2010 1:16pm

    lebisol

    2234 posts

    @vanquish
    404 on url
    should be http://expressionengine.com/docs/development/tutorial.html

    Nice to see CI devs coming over…and hopes for some cool modules.
    Funny though, the more I work with EE the more I want to learn CI

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases