$sql
"; $tmpl = "SELECT * FROM t WHERE a IN (?@)"; $sql = sql_placeholder( $tmpl, array(1,2,3) ); echo "$tmpl
$sql
"; $tmpl = "SELECT * FROM t WHERE a IN (?%)"; $sql = sql_placeholder( $tmpl, array(1,"2'2",3) ); echo "$tmpl
$sql
"; $tmpl = "UPDATE t SET ?%"; $sql = sql_placeholder( $tmpl, array( "a" => "a'aa", "b" => "bbb", ) ); echo "$tmpl
$sql
"; $tmpl = "INSERT INTO t SET ?%all, other=?other"; $ctmpl = sql_compile_placeholder($tmpl); $sql = sql_placeholder( $ctmpl, array( "all" => array("a"=>"a'aa", "x"=>"xxx"), "other" => "bb'b", ) ); echo "$tmpl
$sql
"; $tmpl = "INSERT INTO t SET ?%, other=?"; $ctmpl = sql_compile_placeholder($tmpl); $sql = sql_placeholder( $ctmpl, array("a"=>"a'aa", "x"=>"xxx"), "bb'b" ); echo "$tmpl
$sql
"; $tmpl = "SELECT * FROM t WHERE b=? AND a IN (?@)"; $sql = sql_placeholder( $tmpl, 10, array("2'2", 3, 4) ); echo "$tmpl
$sql
"; $tmpl = "SELECT * FROM t WHERE b=1"; $sql = sql_placeholder( $tmpl ); echo "$tmpl
$sql
"; show_source(__FILE__) ?>