Giter Site home page Giter Site logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
I've done a temporary patch into my code.

$sql = 'SELECT
name, 1, test;'

$parser = new PHPSQLParser($sql); // Fail

$sql    = preg_replace('/^(SELECT)(\s)(\s+)/si', '$1 ', $sql);
$parser = new PHPSQLParser($sql); // Success

Original comment by [email protected] on 14 Dec 2010 at 4:37

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
i did it in "split_sql($sql)"

change 
$sql = str_replace(array('\\\'','\\"'),array("''",'""'), $sql)

to
$sql = str_replace(array("\n","\r",'\\\'','\\"'),array(' ',' ',"''",'""'), 
$sql);

Original comment by [email protected] on 17 Jan 2011 at 8:08

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
here is a diff which 

* makes the reserved and functions array static (results in faster parsing)
* newlines are being replaced with ' ' before parse;
* the sql syntax regarding fulltext i.e. 'match mycol against ('+*foobar*' IN 
BOOLEAN MODE)' is handled better (at least for my needs)

regards 
  Patrik

Original comment by [email protected] on 17 Jan 2011 at 9:58

Attachments:

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Thank, I will patch my own version and try it.

Original comment by [email protected] on 17 Jan 2011 at 11:58

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Thanks for the report - I'll review and incorporate your changes.

Original comment by [email protected] on 4 Feb 2011 at 8:42

  • Changed state: Accepted

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Thanks again for your contribution.

I incorporated your match/against improvement.  I had already made a newline 
fix.

I have not yet switched to static arrays.  

I updated the t/select.php test.

Original comment by [email protected] on 21 Mar 2011 at 7:27

  • Changed state: Verified

from php-sql-parser.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.