1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483 |
- <!DOCTYPE html>
- <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
- <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <title>DB Driver Reference — CodeIgniter 3.1.11 documentation</title>
-
-
-
- <link rel="shortcut icon" href="../_static/ci-icon.ico"/>
-
-
- <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
-
-
-
-
-
-
- <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
-
-
- <link rel="index" title="Index"
- href="../genindex.html"/>
- <link rel="search" title="Search" href="../search.html"/>
- <link rel="top" title="CodeIgniter 3.1.11 documentation" href="../index.html"/>
- <link rel="up" title="Database Reference" href="index.html"/>
- <link rel="next" title="Helpers" href="../helpers/index.html"/>
- <link rel="prev" title="Database Utility Class" href="utilities.html"/>
-
- <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
- </head>
- <body class="wy-body-for-nav" role="document">
- <div id="nav">
- <div id="nav_inner">
-
-
-
- <div id="pulldown-menu" class="ciNav">
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
- </ul>
- </li>
- </ul>
- <ul class="current">
- <li class="toctree-l1 current"><a class="reference internal" href="index.html">Database Reference</a><ul class="current">
- <li class="toctree-l2"><a class="reference internal" href="examples.html">Quick Start: Usage Examples</a></li>
- <li class="toctree-l2"><a class="reference internal" href="configuration.html">Database Configuration</a></li>
- <li class="toctree-l2"><a class="reference internal" href="connecting.html">Connecting to a Database</a></li>
- <li class="toctree-l2"><a class="reference internal" href="queries.html">Running Queries</a></li>
- <li class="toctree-l2"><a class="reference internal" href="results.html">Generating Query Results</a></li>
- <li class="toctree-l2"><a class="reference internal" href="helpers.html">Query Helper Functions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="query_builder.html">Query Builder Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="transactions.html">Transactions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="metadata.html">Getting MetaData</a></li>
- <li class="toctree-l2"><a class="reference internal" href="call_function.html">Custom Function Calls</a></li>
- <li class="toctree-l2"><a class="reference internal" href="caching.html">Query Caching</a></li>
- <li class="toctree-l2"><a class="reference internal" href="forge.html">Database Manipulation with Database Forge</a></li>
- <li class="toctree-l2"><a class="reference internal" href="utilities.html">Database Utilities Class</a></li>
- <li class="toctree-l2 current"><a class="current reference internal" href="#">Database Driver Reference</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
- </ul>
- </li>
- </ul>
- </div>
-
-
- </div>
- </div>
- <div id="nav2">
- <a href="#" id="openToc">
- <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" />
- </a>
- </div>
- <div class="wy-grid-for-nav">
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side">
- <div class="wy-side-nav-search">
-
- <a href="../index.html" class="fa fa-home"> CodeIgniter</a>
-
-
- <div role="search">
- <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </div>
- </div>
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
-
-
-
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
- </ul>
- </li>
- </ul>
- <ul class="current">
- <li class="toctree-l1 current"><a class="reference internal" href="index.html">Database Reference</a><ul class="current">
- <li class="toctree-l2"><a class="reference internal" href="examples.html">Quick Start: Usage Examples</a></li>
- <li class="toctree-l2"><a class="reference internal" href="configuration.html">Database Configuration</a></li>
- <li class="toctree-l2"><a class="reference internal" href="connecting.html">Connecting to a Database</a></li>
- <li class="toctree-l2"><a class="reference internal" href="queries.html">Running Queries</a></li>
- <li class="toctree-l2"><a class="reference internal" href="results.html">Generating Query Results</a></li>
- <li class="toctree-l2"><a class="reference internal" href="helpers.html">Query Helper Functions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="query_builder.html">Query Builder Class</a></li>
- <li class="toctree-l2"><a class="reference internal" href="transactions.html">Transactions</a></li>
- <li class="toctree-l2"><a class="reference internal" href="metadata.html">Getting MetaData</a></li>
- <li class="toctree-l2"><a class="reference internal" href="call_function.html">Custom Function Calls</a></li>
- <li class="toctree-l2"><a class="reference internal" href="caching.html">Query Caching</a></li>
- <li class="toctree-l2"><a class="reference internal" href="forge.html">Database Manipulation with Database Forge</a></li>
- <li class="toctree-l2"><a class="reference internal" href="utilities.html">Database Utilities Class</a></li>
- <li class="toctree-l2 current"><a class="current reference internal" href="#">Database Driver Reference</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
- </ul>
- </li>
- </ul>
-
-
- </div>
-
- </nav>
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
- <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="../index.html">CodeIgniter</a>
- </nav>
-
- <div class="wy-nav-content">
- <div class="rst-content">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="../index.html">Docs</a> »</li>
-
- <li><a href="index.html">Database Reference</a> »</li>
-
- <li>DB Driver Reference</li>
- <li class="wy-breadcrumbs-aside">
-
- </li>
- <div style="float:right;margin-left:5px;" id="closeMe">
- <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
- </div>
- </ul>
- <hr/>
- </div>
- <div role="main" class="document">
-
- <div class="section" id="db-driver-reference">
- <h1>DB Driver Reference<a class="headerlink" href="#db-driver-reference" title="Permalink to this headline">¶</a></h1>
- <p>This is the platform-independent base DB implementation class.
- This class will not be called directly. Rather, the adapter
- class for the specific database will extend and instantiate it.</p>
- <p>The how-to material for this has been split over several articles.
- This article is intended to be a reference for them.</p>
- <div class="admonition important">
- <p class="first admonition-title">Important</p>
- <p class="last">Not all methods are supported by all database drivers,
- some of them may fail (and return FALSE) if the underlying
- driver does not support them.</p>
- </div>
- <dl class="class">
- <dt id="CI_DB_driver">
- <em class="property">class </em><code class="descname">CI_DB_driver</code><a class="headerlink" href="#CI_DB_driver" title="Permalink to this definition">¶</a></dt>
- <dd><dl class="method">
- <dt id="CI_DB_driver::initialize">
- <code class="descname">initialize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::initialize" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE on success, FALSE on failure</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- <p>Initialize database settings, establish a connection to
- the database.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::db_connect">
- <code class="descname">db_connect</code><span class="sig-paren">(</span><em>$persistent = TRUE</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::db_connect" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$persistent</strong> (<em>bool</em>) – Whether to establish a persistent connection or a regular one</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Database connection resource/object or FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Establish a connection with the database.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">The returned value depends on the underlying
- driver in use. For example, a <code class="docutils literal"><span class="pre">mysqli</span></code> instance
- will be returned with the ‘mysqli’ driver.</p>
- </div>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::db_pconnect">
- <code class="descname">db_pconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::db_pconnect" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Database connection resource/object or FALSE on failure</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">mixed</td>
- </tr>
- </tbody>
- </table>
- <p>Establish a persistent connection with the database.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">This method is just an alias for <code class="docutils literal"><span class="pre">db_connect(TRUE)</span></code>.</p>
- </div>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::reconnect">
- <code class="descname">reconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::reconnect" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE on success, FALSE on failure</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- <p>Keep / reestablish the database connection if no queries
- have been sent for a length of time exceeding the
- server’s idle timeout.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::db_select">
- <code class="descname">db_select</code><span class="sig-paren">(</span><span class="optional">[</span><em>$database = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::db_select" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$database</strong> (<em>string</em>) – Database name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Select / switch the current database.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::db_set_charset">
- <code class="descname">db_set_charset</code><span class="sig-paren">(</span><em>$charset</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::db_set_charset" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$charset</strong> (<em>string</em>) – Character set name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Set client character set.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::platform">
- <code class="descname">platform</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::platform" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Platform name</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
- </tr>
- </tbody>
- </table>
- <p>The name of the platform in use (mysql, mssql, etc…).</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::version">
- <code class="descname">version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::version" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The version of the database being used</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
- </tr>
- </tbody>
- </table>
- <p>Database version number.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::query">
- <code class="descname">query</code><span class="sig-paren">(</span><em>$sql</em><span class="optional">[</span>, <em>$binds = FALSE</em><span class="optional">[</span>, <em>$return_object = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::query" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$sql</strong> (<em>string</em>) – The SQL statement to execute</li>
- <li><strong>$binds</strong> (<em>array</em>) – An array of binding data</li>
- <li><strong>$return_object</strong> (<em>bool</em>) – Whether to return a result object or not</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE for successful “write-type” queries, CI_DB_result instance (method chaining) on “query” success, FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Execute an SQL query.</p>
- <p>Accepts an SQL string as input and returns a result object
- upon successful execution of a “read” type query.</p>
- <p>Returns:</p>
- <blockquote>
- <div><ul class="simple">
- <li>Boolean TRUE upon successful execution of a “write type” queries</li>
- <li>Boolean FALSE upon failure</li>
- <li><code class="docutils literal"><span class="pre">CI_DB_result</span></code> object for “read type” queries</li>
- </ul>
- </div></blockquote>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::simple_query">
- <code class="descname">simple_query</code><span class="sig-paren">(</span><em>$sql</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::simple_query" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$sql</strong> (<em>string</em>) – The SQL statement to execute</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Whatever the underlying driver’s “query” function returns</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>A simplified version of the <code class="docutils literal"><span class="pre">query()</span></code> method, appropriate
- for use when you don’t need to get a result object or to
- just send a query to the database and not care for the result.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::affected_rows">
- <code class="descname">affected_rows</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::affected_rows" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Number of rows affected</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
- </tr>
- </tbody>
- </table>
- <p>Returns the number of rows <em>changed</em> by the last executed query.</p>
- <p>Useful for checking how much rows were created, updated or deleted
- during the last executed query.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::trans_strict">
- <code class="descname">trans_strict</code><span class="sig-paren">(</span><span class="optional">[</span><em>$mode = TRUE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::trans_strict" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$mode</strong> (<em>bool</em>) – Strict mode flag</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">void</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Enable/disable transaction “strict” mode.</p>
- <p>When strict mode is enabled, if you are running multiple
- groups of transactions and one group fails, all subsequent
- groups will be rolled back.</p>
- <p>If strict mode is disabled, each group is treated
- autonomously, meaning a failure of one group will not
- affect any others.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::trans_off">
- <code class="descname">trans_off</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::trans_off" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">void</td>
- </tr>
- </tbody>
- </table>
- <p>Disables transactions at run-time.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::trans_start">
- <code class="descname">trans_start</code><span class="sig-paren">(</span><span class="optional">[</span><em>$test_mode = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::trans_start" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$test_mode</strong> (<em>bool</em>) – Test mode flag</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Start a transaction.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::trans_complete">
- <code class="descname">trans_complete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::trans_complete" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE on success, FALSE on failure</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- <p>Complete Transaction.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::trans_status">
- <code class="descname">trans_status</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::trans_status" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE if the transaction succeeded, FALSE if it failed</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- <p>Lets you retrieve the transaction status flag to
- determine if it has failed.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::compile_binds">
- <code class="descname">compile_binds</code><span class="sig-paren">(</span><em>$sql</em>, <em>$binds</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::compile_binds" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$sql</strong> (<em>string</em>) – The SQL statement</li>
- <li><strong>$binds</strong> (<em>array</em>) – An array of binding data</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The updated SQL statement</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Compiles an SQL query with the bind values passed for it.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::is_write_type">
- <code class="descname">is_write_type</code><span class="sig-paren">(</span><em>$sql</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::is_write_type" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$sql</strong> (<em>string</em>) – The SQL statement</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the SQL statement is of “write type”, FALSE if not</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Determines if a query is of a “write” type (such as
- INSERT, UPDATE, DELETE) or “read” type (i.e. SELECT).</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::elapsed_time">
- <code class="descname">elapsed_time</code><span class="sig-paren">(</span><span class="optional">[</span><em>$decimals = 6</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::elapsed_time" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$decimals</strong> (<em>int</em>) – The number of decimal places</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The aggregate query elapsed time, in microseconds</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Calculate the aggregate query elapsed time.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::total_queries">
- <code class="descname">total_queries</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::total_queries" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The total number of queries executed</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
- </tr>
- </tbody>
- </table>
- <p>Returns the total number of queries that have been
- executed so far.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::last_query">
- <code class="descname">last_query</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::last_query" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The last query executed</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
- </tr>
- </tbody>
- </table>
- <p>Returns the last query that was executed.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::escape">
- <code class="descname">escape</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::escape" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$str</strong> (<em>mixed</em>) – The value to escape, or an array of multiple ones</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The escaped value(s)</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Escapes input data based on type, including boolean and
- NULLs.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::escape_str">
- <code class="descname">escape_str</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$like = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::escape_str" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$str</strong> (<em>mixed</em>) – A string value or array of multiple ones</li>
- <li><strong>$like</strong> (<em>bool</em>) – Whether or not the string will be used in a LIKE condition</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The escaped string(s)</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Escapes string values.</p>
- <div class="admonition warning">
- <p class="first admonition-title">Warning</p>
- <p class="last">The returned strings do NOT include quotes
- around them.</p>
- </div>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::escape_like_str">
- <code class="descname">escape_like_str</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::escape_like_str" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$str</strong> (<em>mixed</em>) – A string value or array of multiple ones</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The escaped string(s)</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Escape LIKE strings.</p>
- <p>Similar to <code class="docutils literal"><span class="pre">escape_str()</span></code>, but will also escape the <code class="docutils literal"><span class="pre">%</span></code>
- and <code class="docutils literal"><span class="pre">_</span></code> wildcard characters, so that they don’t cause
- false-positives in LIKE conditions.</p>
- <div class="admonition important">
- <p class="first admonition-title">Important</p>
- <p class="last">The <code class="docutils literal"><span class="pre">escape_like_str()</span></code> method uses ‘!’ (exclamation mark)
- to escape special characters for <em>LIKE</em> conditions. Because this
- method escapes partial strings that you would wrap in quotes
- yourself, it cannot automatically add the <code class="docutils literal"><span class="pre">ESCAPE</span> <span class="pre">'!'</span></code>
- condition for you, and so you’ll have to manually do that.</p>
- </div>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::primary">
- <code class="descname">primary</code><span class="sig-paren">(</span><em>$table</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::primary" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table</strong> (<em>string</em>) – Table name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The primary key name, FALSE if none</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Retrieves the primary key of a table.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">If the database platform does not support primary
- key detection, the first column name may be assumed
- as the primary key.</p>
- </div>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::count_all">
- <code class="descname">count_all</code><span class="sig-paren">(</span><span class="optional">[</span><em>$table = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::count_all" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table</strong> (<em>string</em>) – Table name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Row count for the specified table</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Returns the total number of rows in a table, or 0 if no
- table was provided.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::list_tables">
- <code class="descname">list_tables</code><span class="sig-paren">(</span><span class="optional">[</span><em>$constrain_by_prefix = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::list_tables" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$constrain_by_prefix</strong> (<em>bool</em>) – TRUE to match table names by the configured dbprefix</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Array of table names or FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">array</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Gets a list of the tables in the current database.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::table_exists">
- <code class="descname">table_exists</code><span class="sig-paren">(</span><em>$table_name</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::table_exists" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table_name</strong> (<em>string</em>) – The table name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if that table exists, FALSE if not</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Determine if a particular table exists.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::list_fields">
- <code class="descname">list_fields</code><span class="sig-paren">(</span><em>$table</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::list_fields" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table</strong> (<em>string</em>) – The table name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Array of field names or FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">array</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Gets a list of the field names in a table.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::field_exists">
- <code class="descname">field_exists</code><span class="sig-paren">(</span><em>$field_name</em>, <em>$table_name</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::field_exists" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table_name</strong> (<em>string</em>) – The table name</li>
- <li><strong>$field_name</strong> (<em>string</em>) – The field name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if that field exists in that table, FALSE if not</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Determine if a particular field exists.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::field_data">
- <code class="descname">field_data</code><span class="sig-paren">(</span><em>$table</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::field_data" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table</strong> (<em>string</em>) – The table name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Array of field data items or FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">array</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Gets a list containing field data about a table.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::escape_identifiers">
- <code class="descname">escape_identifiers</code><span class="sig-paren">(</span><em>$item</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::escape_identifiers" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$item</strong> (<em>mixed</em>) – The item or array of items to escape</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The input item(s), escaped</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Escape SQL identifiers, such as column, table and names.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::insert_string">
- <code class="descname">insert_string</code><span class="sig-paren">(</span><em>$table</em>, <em>$data</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::insert_string" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table</strong> (<em>string</em>) – The target table</li>
- <li><strong>$data</strong> (<em>array</em>) – An associative array of key/value pairs</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The SQL INSERT statement, as a string</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Generate an INSERT statement string.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::update_string">
- <code class="descname">update_string</code><span class="sig-paren">(</span><em>$table</em>, <em>$data</em>, <em>$where</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::update_string" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$table</strong> (<em>string</em>) – The target table</li>
- <li><strong>$data</strong> (<em>array</em>) – An associative array of key/value pairs</li>
- <li><strong>$where</strong> (<em>mixed</em>) – The WHERE statement conditions</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The SQL UPDATE statement, as a string</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Generate an UPDATE statement string.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::call_function">
- <code class="descname">call_function</code><span class="sig-paren">(</span><em>$function</em><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::call_function" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$function</strong> (<em>string</em>) – Function name</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The function result</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Runs a native PHP function , using a platform agnostic
- wrapper.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::cache_set_path">
- <code class="descname">cache_set_path</code><span class="sig-paren">(</span><span class="optional">[</span><em>$path = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::cache_set_path" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$path</strong> (<em>string</em>) – Path to the cache directory</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">void</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Sets the directory path to use for caching storage.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::cache_on">
- <code class="descname">cache_on</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::cache_on" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE if caching is on, FALSE if not</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- <p>Enable database results caching.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::cache_off">
- <code class="descname">cache_off</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::cache_off" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE if caching is on, FALSE if not</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- <p>Disable database results caching.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::cache_delete">
- <code class="descname">cache_delete</code><span class="sig-paren">(</span><span class="optional">[</span><em>$segment_one = ''</em><span class="optional">[</span>, <em>$segment_two = ''</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::cache_delete" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$segment_one</strong> (<em>string</em>) – First URI segment</li>
- <li><strong>$segment_two</strong> (<em>string</em>) – Second URI segment</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Delete the cache files associated with a particular URI.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::cache_delete_all">
- <code class="descname">cache_delete_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::cache_delete_all" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE on success, FALSE on failure</td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
- </tr>
- </tbody>
- </table>
- <p>Delete all cache files.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::close">
- <code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::close" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">void</td>
- </tr>
- </tbody>
- </table>
- <p>Close the DB Connection.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::display_error">
- <code class="descname">display_error</code><span class="sig-paren">(</span><span class="optional">[</span><em>$error = ''</em><span class="optional">[</span>, <em>$swap = ''</em><span class="optional">[</span>, <em>$native = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::display_error" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$error</strong> (<em>string</em>) – The error message</li>
- <li><strong>$swap</strong> (<em>string</em>) – Any “swap” values</li>
- <li><strong>$native</strong> (<em>bool</em>) – Whether to localize the message</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">void</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Displays the DB error screensends the application/views/errors/error_db.php template</p>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Display an error message and stop script execution.</p>
- <p>The message is displayed using the
- <em>application/views/errors/error_db.php</em> template.</p>
- </dd></dl>
- <dl class="method">
- <dt id="CI_DB_driver::protect_identifiers">
- <code class="descname">protect_identifiers</code><span class="sig-paren">(</span><em>$item</em><span class="optional">[</span>, <em>$prefix_single = FALSE</em><span class="optional">[</span>, <em>$protect_identifiers = NULL</em><span class="optional">[</span>, <em>$field_exists = TRUE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#CI_DB_driver::protect_identifiers" title="Permalink to this definition">¶</a></dt>
- <dd><table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>$item</strong> (<em>string</em>) – The item to work with</li>
- <li><strong>$prefix_single</strong> (<em>bool</em>) – Whether to apply the dbprefix even if the input item is a single identifier</li>
- <li><strong>$protect_identifiers</strong> (<em>bool</em>) – Whether to quote identifiers</li>
- <li><strong>$field_exists</strong> (<em>bool</em>) – Whether the supplied item contains a field name or not</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The modified item</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>Takes a column or table name (optionally with an alias)
- and applies the configured <em>dbprefix</em> to it.</p>
- <p>Some logic is necessary in order to deal with
- column names that include the path.</p>
- <p>Consider a query like this:</p>
- <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">SELECT</span> <span class="o">*</span> <span class="nx">FROM</span> <span class="nx">hostname</span><span class="o">.</span><span class="nx">database</span><span class="o">.</span><span class="nx">table</span><span class="o">.</span><span class="nx">column</span> <span class="k">AS</span> <span class="nx">c</span> <span class="nx">FROM</span> <span class="nx">hostname</span><span class="o">.</span><span class="nx">database</span><span class="o">.</span><span class="nx">table</span>
- </pre></div>
- </div>
- <p>Or a query with aliasing:</p>
- <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">SELECT</span> <span class="nx">m</span><span class="o">.</span><span class="nx">member_id</span><span class="p">,</span> <span class="nx">m</span><span class="o">.</span><span class="nx">member_name</span> <span class="nx">FROM</span> <span class="nx">members</span> <span class="k">AS</span> <span class="nx">m</span>
- </pre></div>
- </div>
- <p>Since the column name can include up to four segments
- (host, DB, table, column) or also have an alias prefix,
- we need to do a bit of work to figure this out and
- insert the table prefix (if it exists) in the proper
- position, and escape only the correct identifiers.</p>
- <p>This method is used extensively by the Query Builder class.</p>
- </dd></dl>
- </dd></dl>
- </div>
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="../helpers/index.html" class="btn btn-neutral float-right" title="Helpers">Next <span class="fa fa-arrow-circle-right"></span></a>
-
-
- <a href="utilities.html" class="btn btn-neutral" title="Database Utility Class"><span class="fa fa-arrow-circle-left"></span> Previous</a>
-
- </div>
-
- <hr/>
- <div role="contentinfo">
- <p>
- © Copyright 2014 - 2019, British Columbia Institute of Technology.
- Last updated on Sep 19, 2019.
- </p>
- </div>
- Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
-
- </footer>
- </div>
- </div>
- </section>
- </div>
-
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT:'../',
- VERSION:'3.1.11',
- COLLAPSE_INDEX:false,
- FILE_SUFFIX:'.html',
- HAS_SOURCE: false
- };
- </script>
- <script type="text/javascript" src="../_static/jquery.js"></script>
- <script type="text/javascript" src="../_static/underscore.js"></script>
- <script type="text/javascript" src="../_static/doctools.js"></script>
-
-
-
- <script type="text/javascript" src="../_static/js/theme.js"></script>
-
-
-
- <script type="text/javascript">
- jQuery(function () {
- SphinxRtdTheme.StickyNav.enable();
- });
- </script>
-
- </body>
- </html>
|