Re: SQL_Parser
| From: | Stefan Neufeind | Date: | Fri, 19 Dec 2003 15:54:08 +0000 |
| Subject: | Re: SQL_Parser | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24539@lists.php.net to get a copy of this message | ||
On 19 Dec 2003 at 16:50, Webmaster@STR wrote:
> > From: coil at strangebuzz dot com
> > Operating system: 2K + Esay PHP 1.7
> > PHP version: 4.3.4
> > P Bug Type: SQL_Parser
> > Bug description: Notice with function
>
> About this package SQL, i was think a fucntion that would help me as i
> made a class for debug infos.
>
> This function would take a query in param :
>
> function formatQueryString($Sql, $FormatMode)
> {
> ..
> }
>
> Depending the FormatMode, the query would be returned
> as formated test with indentation :
>
> // Silly example
> formatQueryString("select * from User Where nUserID in ( Select
> nUserID from user where nUserID = 12 )");
>
> The returned string would be :
>
> SELECT * FROM User
> WHERE nUserID IN
> ( SELECT nUserID
> FROM User WHERE nUserID = 12 )
>
> We can imagine different modes, with html table, bold style
> for SQL keyword and so on... It sould be usefull, what
> do you think about it ?
Yeah, in general a nice idea in my eyes. You could check with
phpMyAdmin to not reinvent the wheel. Maybe they could even rely on a
common library with us that would be used for such parsings.
Regards,
Stefan