Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaped values in $parser->parsed['VALUES'] become '' instead of \' #35

Closed
GoogleCodeExporter opened this issue Mar 23, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
<?php

// require("php-sql-parser.php");
require("PHPSQLParser.php");

$sql = "INSERT INTO test (`name`) VALUES ('ben\'s test containing an escaped 
quote')";

$parser = new PHPSQLParser($sql);

echo "<pre>";
print_r( $parser->parsed );
echo "</pre>";

What is the expected output? What do you see instead?
EXPECTED:
[VALUES] => Array
        (
            [0] => ('ben\'s test containing an escaped quote')
        )

OBSERVED:
[VALUES] => Array
        (
            [0] => ('ben''s test containing an escaped quote')
        )



What version of the product are you using? On what operating system?
Both of the following have the issue:
http://www.phosco.info/php-sql-parser_current.zip
http://php-sql-parser.googlecode.com/svn/trunk/php-sql-parser.php



Original issue reported on code.google.com by ben.swin...@gmail.com on 5 Mar 2012 at 10:32

@GoogleCodeExporter
Copy link
Author

Fixed in current version on 
https://www.phosco.info/publicsvn/php-sql-parser/trunk

Thanks for reporting
Andre

Original comment by pho...@gmx.de on 6 Mar 2012 at 8:35

@GoogleCodeExporter
Copy link
Author

Many thanks for the quick response. Any chance you can briefly explain the fix?

The version I'm currently having to stick with isn't from your repository and I 
can't just drop in the update as it behaves slightly differently. I plan to 
move to your version but need to wait for my boss to schedule in some 
development time to port the legacy software.

Original comment by ben.swin...@gmail.com on 6 Mar 2012 at 8:41

@GoogleCodeExporter
Copy link
Author

I can confirm that this has been fixed on the aforementioned repository.

Original comment by ben.swin...@gmail.com on 13 Mar 2012 at 10:00

@GoogleCodeExporter
Copy link
Author

Original comment by pho...@gmx.de on 13 Mar 2012 at 12:11

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant