Welcome Guest, Not a member yet? Register   Sign In
MySQL copy table
#1

[eluser]Unknown[/eluser]
I'm trying to execute a MySQL COPY TABLE command, and can't figure out how to do this through an Active Record class. It doesn't really fall under Selecting, Inserting, Updating, or Deleting.

Is this possible? I've been reading the Active Record Class page at http://ellislab.com/codeigniter/user-gui...ecord.html, and googling around, but nothing seems to pop up.

Anything along the lines of $this->db->do or $this->db->execute would be great; something that lets me execute an arbitrary SQL query. Anyone have ideas?

Thanks =)
#2

[eluser]Jamie Rumbelow[/eluser]
Hey garrett.reid,

Because COPY TABLE is a proprietary command, you will have to run custom SQL, but usually, stuff like this falls under the Database Forge library, which is really neat, so go and check it out. To run raw SQL, just use the $this->db->query() command, which has exactly the same response as $this->db->get() (which uses query underneath.)

Jamie




Theme © iAndrew 2016 - Forum software by © MyBB