"Ken Guest" <k...@linux.ie> wrote:

>On Fri, May 6, 2011 at 10:05 AM, Ashley Sheridan
><a...@ashleysheridan.co.uk> wrote:
>> Hiya, has anyone had any experience with parsing a string of sql to
>break it down into its component parts? At the moment I'm using several
>regex's to parse a string, which works, but I'm sure there's a more
>elegant solution.
>>
>> The general idea is to produce a nice looking page giving details of
>updated fields and values.
>>
>> I'm only concerned with update statements really, and the queries are
>very simple, operating on one table at a time, with no sub queries or
>selects.
>>
>> Thanks in advance if anyone is able to suggest anything!
>
>I'd suggest at least taking a look at pear's sql parser package -
>using it might save you some headaches ;)
>
>http://pear.php.net/package/SQL_Parser
>
>
>> Thanks
>> Ash
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
>--
>http://blogs.linux.ie/kenguest/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

I had seen this but didn't see much in the way of documentation (i only spent 5 
mins looking though) and I've tended to steer away from pear after warnings 
from this very list!

I solved the issue in the end with regex's. As the queries were generally 
fairly basic, it wasn't too hard to write the expressions for them, and so far 
its working well for my needs. I was just asking here to see if anyone had any 
experience with something, not to see if they could phrase the Google search in 
a different way. Thanks though to all who replied.

Thanks
Ash
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to