PHP PEAR Sql_Parser

A parser for SQL statements

Install
Install
# pear install "channel://pear.php.net/SQL_Parser-0.5"


Use
PHP
<?php

include 'SQL/Parser.php';

$p = new SQL_Parser();

$s = "select a from pin p left join cust c on a=b left join tele t where c.a > 3";
$res = $p->parse($s);
echo "<pre>"; print_r ( $res ) ; echo "</pre>";

$s = "delete from pin where a > 3";
$res = $p->parse($s);
echo "<pre>"; print_r ( $res ) ; echo "</pre>";

$s = "update pin set a=3 where a >3";
$res = $p->parse($s);
echo "<pre>"; print_r ( $res ) ; echo "</pre>";

?>

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki