PHP Classes

File: examples/sql/example_prepare.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/sql/example_prepare.php   Download  
File: examples/sql/example_prepare.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 576 bytes
 

Contents

Class file image Download
<?php
include 'config.php';

$prepare = new A_Sql_Prepare("INSERT mytable SET one=?, two='?', three=:three, three=?");
$prepare->bind("foo's", array(':three'=>'faz'), 'bar', 1);
echo
"Default is escaping, but no quoting<br/>A_Db_Prepare::render=" . $prepare->render() . '<br/>';

$prepare = new A_Sql_Prepare("INSERT mytable SET one=?, two=?, three=:three, three=?");
$prepare->quoteValues()->bind("foo's", array(':three'=>'faz'), 'bar', 1);
echo
"With quoting on by calling quoteValues()<br/>A_Db_Prepare::render=" . $prepare->render() . '<br/>';

#dump($prepare);