We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

updating one off table without exp prefix

Development and Programming

skgreene's avatar
skgreene
40 posts
15 years ago
skgreene's avatar skgreene

Hi -

We have a third party system that writes data into the database nightly. From there I’m writing a custom module that will periodically update the said data in the same table. Unfortunately, this table doesn’t share the “exp” prefix that the rest of the tables do. Is there a way to tell $this->EE->db->update_string not to add the prefix?

summer

       
the3mus1can's avatar
the3mus1can
426 posts
15 years ago
the3mus1can's avatar the3mus1can

Try this:

$dbprefix = $this->EE->db->dbprefix;
$this->EE->db->dbprefix = '';

....run your queries without exp prefix....

$this->EE->db->dbprefix = $dbprefix;
       
Ralph's avatar
Ralph
78 posts
14 years ago
Ralph's avatar Ralph

or put this in your constructor

$this->db = clone $this->EE->db;
$this->db->dbprefix='';

and use $this->db

$result = $this->db->get('mytable');
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.