admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
Derek Allard | afd99ac | 2008-01-19 19:59:14 +0000 | [diff] [blame] | 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 3 | <head>
|
| 4 |
|
Derek Allard | 8039d4c | 2008-05-31 02:47:56 +0000 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
Derek Jones | fd93d22 | 2008-05-06 15:18:50 +0000 | [diff] [blame] | 6 | <title>Database Utility Class : CodeIgniter User Guide</title>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 7 |
|
| 8 | <style type='text/css' media='all'>@import url('../userguide.css');</style>
|
| 9 | <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
|
| 10 |
|
admin | 17a890d | 2006-09-27 20:42:42 +0000 | [diff] [blame] | 11 | <script type="text/javascript" src="../nav/nav.js"></script>
|
admin | 2296fc3 | 2006-09-27 21:07:02 +0000 | [diff] [blame] | 12 | <script type="text/javascript" src="../nav/prototype.lite.js"></script>
|
admin | 17a890d | 2006-09-27 20:42:42 +0000 | [diff] [blame] | 13 | <script type="text/javascript" src="../nav/moo.fx.js"></script>
|
Derek Allard | b341237 | 2007-10-25 12:15:16 +0000 | [diff] [blame] | 14 | <script type="text/javascript" src="../nav/user_guide_menu.js"></script>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 15 |
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 16 | <meta http-equiv='expires' content='-1' />
|
| 17 | <meta http-equiv= 'pragma' content='no-cache' />
|
| 18 | <meta name='robots' content='all' />
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 19 | <meta name='author' content='ExpressionEngine Dev Team' />
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 20 | <meta name='description' content='CodeIgniter User Guide' />
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 21 |
|
| 22 | </head>
|
| 23 | <body>
|
| 24 |
|
| 25 | <!-- START NAVIGATION -->
|
| 26 | <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
|
Rick Ellis | 7cdef03 | 2008-08-26 18:44:54 +0000 | [diff] [blame] | 27 | <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 28 | <div id="masthead">
|
| 29 | <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
|
| 30 | <tr>
|
Rick Ellis | 2594953 | 2008-08-26 19:48:08 +0000 | [diff] [blame] | 31 | <td><h1>CodeIgniter User Guide Version 1.7</h1></td>
|
admin | c0d5d52 | 2006-10-30 19:40:35 +0000 | [diff] [blame] | 32 | <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 33 | </tr>
|
| 34 | </table>
|
| 35 | </div>
|
| 36 | <!-- END NAVIGATION -->
|
| 37 |
|
| 38 |
|
| 39 | <!-- START BREADCRUMB -->
|
| 40 | <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
|
| 41 | <tr>
|
| 42 | <td id="breadcrumb">
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 43 | <a href="http://codeigniter.com/">CodeIgniter Home</a> ›
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 44 | <a href="../index.html">User Guide Home</a> ›
|
| 45 | <a href="index.html">Database Library</a> ›
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 46 | Database Utility Class
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 47 | </td>
|
Derek Allard | bc03091 | 2007-06-24 18:25:29 +0000 | [diff] [blame] | 48 | <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 49 | </tr>
|
| 50 | </table>
|
| 51 | <!-- END BREADCRUMB -->
|
| 52 |
|
| 53 |
|
| 54 | <br clear="all" />
|
| 55 |
|
| 56 |
|
| 57 | <!-- START CONTENT -->
|
| 58 | <div id="content">
|
| 59 |
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 60 | <h1>Database Utility Class</h1>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 61 |
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 62 | <p>The Database Utility Class contains functions that help you manage your database.</p>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 63 |
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 64 | <h3>Table of Contents</h3>
|
| 65 |
|
| 66 | <ul>
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 67 | <li><a href="#init">Initializing the Utility Class</a></li>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 68 | <li><a href="#list">Listing your Databases</a></li>
|
| 69 | <li><a href="#opttb">Optimizing your Tables</a></li>
|
| 70 | <li><a href="#repair">Repairing your Databases</a></li>
|
| 71 | <li><a href="#optdb">Optimizing your Database</a></li>
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 72 | <li><a href="#csv">CSV Files from a Database Result</a></li>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 73 | <li><a href="#xml">XML Files from a Database Result</a></li>
|
| 74 | <li><a href="#backup">Backing up your Database</a></li>
|
| 75 | </ul>
|
| 76 |
|
| 77 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 78 |
|
| 79 | <h2><a name="init"></a>Initializing the Utility Class</h2>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 80 |
|
admin | fd2750b | 2006-10-06 17:29:12 +0000 | [diff] [blame] | 81 | <p class="important"><strong>Important:</strong> In order to initialize the Utility class, your database driver must
|
admin | 572ed81 | 2006-10-12 18:01:52 +0000 | [diff] [blame] | 82 | already be running, since the utilities class relies on it.</p>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 83 |
|
admin | fd2750b | 2006-10-06 17:29:12 +0000 | [diff] [blame] | 84 | <p>Load the Utility Class as follows:</p>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 85 |
|
admin | 572ed81 | 2006-10-12 18:01:52 +0000 | [diff] [blame] | 86 | <code>$this->load->dbutil()</code>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 87 |
|
| 88 | <p>Once initialized you will access the functions using the <dfn>$this->dbutil</dfn> object:</p>
|
| 89 |
|
| 90 | <code>$this->dbutil->some_function()</code>
|
| 91 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 92 | <h2><a name="list"></a>$this->dbutil->list_databases()</h2>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 93 | <p>Returns an array of database names:</p>
|
| 94 |
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 95 | <code>
|
| 96 | $dbs = $this->dbutil->list_databases();<br />
|
| 97 | <br />
|
| 98 | foreach($dbs as $db)<br />
|
| 99 | {<br />
|
| 100 | echo $db;<br />
|
| 101 | }</code>
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 102 | <h2><a name="opttb"></a>$this->dbutil->optimize_table('table_name');</h2>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 103 |
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 104 | <p class="important"><strong>Note:</strong> This features is only available for MySQL/MySQLi databases.</p>
|
| 105 |
|
| 106 |
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 107 | <p>Permits you to optimize a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:</p>
|
| 108 |
|
| 109 | <code>
|
| 110 | if ($this->dbutil->optimize_table('table_name'))<br />
|
| 111 | {<br />
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 112 | echo 'Success!';<br />
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 113 | }
|
| 114 | </code>
|
| 115 |
|
| 116 | <p><strong>Note:</strong> Not all database platforms support table optimization.</p>
|
| 117 |
|
| 118 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 119 | <h2><a name="repair"></a>$this->dbutil->repair_table('table_name');</h2>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 120 |
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 121 | <p class="important"><strong>Note:</strong> This features is only available for MySQL/MySQLi databases.</p>
|
| 122 |
|
| 123 |
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 124 | <p>Permits you to repair a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:</p>
|
| 125 |
|
| 126 | <code>
|
admin | 985a638 | 2006-10-28 18:47:16 +0000 | [diff] [blame] | 127 | if ($this->dbutil->repair_table('table_name'))<br />
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 128 | {<br />
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 129 | echo 'Success!';<br />
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 130 | }
|
| 131 | </code>
|
| 132 |
|
| 133 | <p><strong>Note:</strong> Not all database platforms support table repairs.</p>
|
| 134 |
|
| 135 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 136 | <h2><a name="optdb"></a>$this->dbutil->optimize_database();</h2>
|
admin | e5bb936 | 2006-09-27 00:31:22 +0000 | [diff] [blame] | 137 |
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 138 | <p class="important"><strong>Note:</strong> This features is only available for MySQL/MySQLi databases.</p>
|
| 139 |
|
admin | 985a638 | 2006-10-28 18:47:16 +0000 | [diff] [blame] | 140 | <p>Permits you to optimize the database your DB class is currently connected to. Returns an array containing the DB status messages or FALSE on failure.</p>
|
admin | e5bb936 | 2006-09-27 00:31:22 +0000 | [diff] [blame] | 141 |
|
| 142 | <code>
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 143 | $result = $this->dbutil->optimize_database();<br />
|
admin | e5bb936 | 2006-09-27 00:31:22 +0000 | [diff] [blame] | 144 | <br />
|
| 145 | if ($result !== FALSE)<br />
|
| 146 | {<br />
|
| 147 | print_r($result);<br />
|
| 148 | }
|
| 149 | </code>
|
| 150 |
|
| 151 | <p><strong>Note:</strong> Not all database platforms support table optimization.</p>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 152 |
|
| 153 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 154 | <h2><a name="csv"></a>$this->dbutil->csv_from_result($db_result)</h2>
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 155 |
|
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 156 | <p>Permits you to generate a CSV file from a query result. The first parameter of the function must contain the result object from your query.
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 157 | Example:</p>
|
| 158 |
|
| 159 | <code>
|
| 160 | $this->load->dbutil();<br />
|
| 161 | <br />
|
| 162 | $query = $this->db->query("SELECT * FROM mytable");<br />
|
| 163 | <br />
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 164 | echo $this->dbutil->csv_from_result($query);
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 165 | </code>
|
| 166 |
|
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 167 | <p>The second and third parameters allows you to
|
Derek Allard | c644128 | 2007-07-04 23:54:32 +0000 | [diff] [blame] | 168 | set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:</p>
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 169 |
|
| 170 | <code>
|
| 171 | $delimiter = ",";<br />
|
| 172 | $newline = "\r\n";<br />
|
| 173 | <br />
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 174 | echo $this->dbutil->csv_from_result($query, $delimiter, $newline);
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 175 | </code>
|
| 176 |
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 177 | <p><strong>Important:</strong> This function will NOT write the CSV file for you. It simply creates the CSV layout.
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 178 | If you need to write the file use the <a href="../helpers/file_helper.html">File Helper</a>.</p>
|
| 179 |
|
| 180 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 181 | <h2><a name="xml"></a>$this->dbutil->xml_from_result($db_result)</h2>
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 182 |
|
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 183 | <p>Permits you to generate an XML file from a query result. The first parameter expects a query result object, the second
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 184 | may contain an optional array of config parameters. Example:</p>
|
| 185 |
|
| 186 | <code>
|
| 187 | $this->load->dbutil();<br />
|
| 188 | <br />
|
| 189 | $query = $this->db->query("SELECT * FROM mytable");<br />
|
| 190 | <br />
|
| 191 | $config = array (<br />
|
| 192 | 'root' => 'root',<br />
|
| 193 | 'element' => 'element', <br />
|
| 194 | 'newline' => "\n", <br />
|
admin | c5f7fa3 | 2006-10-06 02:10:23 +0000 | [diff] [blame] | 195 | 'tab' => "\t"<br />
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 196 | );<br />
|
| 197 | <br />
|
admin | 24dd7e7 | 2006-10-01 19:02:29 +0000 | [diff] [blame] | 198 | echo $this->dbutil->xml_from_result($query, $config);
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 199 | </code>
|
| 200 |
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 201 | <p><strong>Important:</strong> This function will NOT write the XML file for you. It simply creates the XML layout.
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 202 | If you need to write the file use the <a href="../helpers/file_helper.html">File Helper</a>.</p>
|
| 203 |
|
| 204 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 205 | <h2><a name="backup"></a>$this->dbutil->backup()</h2>
|
admin | 3dd978f | 2006-09-30 19:24:45 +0000 | [diff] [blame] | 206 |
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 207 | <p>Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.</p>
|
admin | 0e42554 | 2006-10-01 03:37:43 +0000 | [diff] [blame] | 208 |
|
Derek Allard | 11c75ea | 2008-01-29 19:35:31 +0000 | [diff] [blame] | 209 | <p class="important"><strong>Note:</strong> This features is only available for MySQL databases.</p>
|
admin | f66de86 | 2006-10-10 23:30:04 +0000 | [diff] [blame] | 210 |
|
admin | 0e42554 | 2006-10-01 03:37:43 +0000 | [diff] [blame] | 211 | <p>Note: Due to the limited execution time and memory available to PHP, backing up very large
|
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 212 | databases may not be possible. If your database is very large you might need to backup directly from your SQL server
|
admin | 0e42554 | 2006-10-01 03:37:43 +0000 | [diff] [blame] | 213 | via the command line, or have your server admin do it for you if you do not have root privileges.</p>
|
| 214 |
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 215 | <h3>Usage Example</h3>
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 216 |
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 217 | <code>
|
| 218 | <dfn>// Load the DB utility class</dfn><br />
|
| 219 | $this->load->dbutil();<br /><br />
|
| 220 |
|
admin | c5f7fa3 | 2006-10-06 02:10:23 +0000 | [diff] [blame] | 221 | <dfn>// Backup your entire database and assign it to a variable</dfn><br />
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 222 | $backup =& $this->dbutil->backup();
|
| 223 |
|
| 224 | <br /><br />
|
| 225 | <dfn>// Load the file helper and write the file to your server</dfn><br />
|
| 226 | $this->load->helper('file');<br />
|
| 227 | write_file('/path/to/mybackup.gz', $backup);
|
| 228 |
|
| 229 | <br /><br />
|
| 230 | <dfn>// Load the download helper and send the file to your desktop</dfn><br />
|
| 231 | $this->load->helper('download');<br />
|
| 232 | force_download('mybackup.gz', $backup);
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 233 | </code>
|
admin | 3ed8c51 | 2006-09-29 23:26:28 +0000 | [diff] [blame] | 234 |
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 235 | <h3>Setting Backup Preferences</h3>
|
| 236 |
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 237 | <p>Backup preferences are set by submitting an array of values to the first parameter of the backup function. Example:</p>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 238 |
|
| 239 | <code>$prefs = array(<br />
|
| 240 | 'tables' => array('table1', 'table2'), // Array of tables to backup.<br />
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 241 | 'ignore' => array(), // List of tables to omit from the backup<br />
|
| 242 | 'format' => 'txt', // gzip, zip, txt<br />
|
| 243 | 'filename' => 'mybackup.sql', // File name - NEEDED ONLY WITH ZIP FILES<br />
|
| 244 | 'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file<br />
|
| 245 | 'add_insert' => TRUE, // Whether to add INSERT data to backup file<br />
|
| 246 | 'newline' => "\n" // Newline character used in backup file<br />
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 247 | );<br />
|
| 248 | <br />
|
| 249 | $this->dbutil->backup($prefs);
|
| 250 | </code>
|
| 251 |
|
admin | 0e42554 | 2006-10-01 03:37:43 +0000 | [diff] [blame] | 252 |
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 253 | <h3>Description of Backup Preferences</h3>
|
| 254 |
|
| 255 | <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
|
| 256 | <tr>
|
| 257 | <th>Preference</th>
|
| 258 | <th>Default Value</th>
|
| 259 | <th>Options</th>
|
| 260 | <th>Description</th>
|
| 261 | </tr><tr>
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 262 | <td class="td"><strong>tables</strong></td><td class="td">empty array</td><td class="td">None</td><td class="td">An array of tables you want backed up. If left blank all tables will be exported.</td>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 263 | </tr><tr>
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 264 | <td class="td"><strong>ignore</strong></td><td class="td">empty array</td><td class="td">None</td><td class="td">An array of tables you want the backup routine to ignore.</td>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 265 | </tr><tr>
|
| 266 | <td class="td"><strong>format</strong></td><td class="td">gzip</td><td class="td">gzip, zip, txt</td><td class="td">The file format of the export file.</td>
|
| 267 | </tr><tr>
|
admin | e856ff4 | 2006-10-02 02:38:30 +0000 | [diff] [blame] | 268 | <td class="td"><strong>filename</strong></td><td class="td">the current date/time</td><td class="td">None</td><td class="td">The name of the backed-up file. The name is needed only if you are using zip compression.</td>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 269 | </tr><tr>
|
| 270 | <td class="td"><strong>add_drop</strong></td><td class="td">TRUE</td><td class="td">TRUE/FALSE</td><td class="td">Whether to include DROP TABLE statements in your SQL export file.</td>
|
| 271 | </tr><tr>
|
admin | 4003718 | 2006-10-11 19:16:58 +0000 | [diff] [blame] | 272 | <td class="td"><strong>add_insert</strong></td><td class="td">TRUE</td><td class="td">TRUE/FALSE</td><td class="td">Whether to include INSERT statements in your SQL export file.</td>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 273 | </tr><tr>
|
admin | 4003718 | 2006-10-11 19:16:58 +0000 | [diff] [blame] | 274 | <td class="td"><strong>newline</strong></td><td class="td">"\n"</td><td class="td">"\n", "\r", "\r\n"</td><td class="td">Type of newline to use in your SQL export file.</td>
|
admin | 32cb0e5 | 2006-09-30 20:36:59 +0000 | [diff] [blame] | 275 |
|
| 276 | </tr>
|
| 277 | </table>
|
| 278 |
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 279 |
|
| 280 | </div>
|
| 281 | <!-- END CONTENT -->
|
| 282 |
|
| 283 |
|
| 284 | <div id="footer">
|
| 285 | <p>
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 286 | Previous Topic: <a href="forge.html">DB Forge Class</a>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 287 | ·
|
| 288 | <a href="#top">Top of Page</a> ·
|
| 289 | <a href="../index.html">User Guide Home</a> ·
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 290 | Next Topic: <a href="../libraries/email.html"> Email Class</a></p>
|
Derek Jones | 0787043 | 2008-02-13 03:49:26 +0000 | [diff] [blame] | 291 | <p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2008 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
|
admin | 3b60ae4 | 2006-09-25 23:26:03 +0000 | [diff] [blame] | 292 | </div>
|
| 293 |
|
| 294 | </body>
|
| 295 | </html> |