SQLitePreparedStatement.php

Go to the documentation of this file.
00001 <?php 00002 /* 00003 * $Id: SQLitePreparedStatement.php,v 1.7 2004/03/20 04:16:50 hlellelid Exp $ 00004 * 00005 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00006 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00007 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00008 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00009 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00010 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00011 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00012 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00013 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00014 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00015 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 * 00017 * This software consists of voluntary contributions made by many individuals 00018 * and is licensed under the LGPL. For more information please see 00019 * <http://creole.phpdb.org>. 00020 */ 00021 00022 require_once 'creole/PreparedStatement.php'; 00023 require_once 'creole/common/PreparedStatementCommon.php'; 00024 00032 class SQLitePreparedStatement extends PreparedStatementCommon implements PreparedStatement { 00033 00038 protected function escape($str) 00039 { 00040 return sqlite_escape_string($str); 00041 } 00042 00048 function setBlob($paramIndex, $blob) 00049 { 00050 if ($blob === null) { 00051 $this->setNull($paramIndex); 00052 } else { 00053 // they took magic __toString() out of PHP5.0.0; this sucks 00054 if (is_object($blob)) { 00055 $blob = $blob->__toString(); 00056 } 00057 $this->boundInVars[$paramIndex] = "'" . sqlite_udf_encode_binary( $blob ) . "'"; 00058 } 00059 } 00060 00061 }

This file is part of the Creole[php5] library.


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS