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

Fatal Error, undefined method #154

Open
GoogleCodeExporter opened this issue Mar 22, 2016 · 1 comment
Open

Fatal Error, undefined method #154

GoogleCodeExporter opened this issue Mar 22, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
    $parser = new PHPSQLParser();
    $creator = new PHPSQLCreator();

    $query = "DELETE FROM table_name WHERE column_name = 'column_value'";
    $tree = $parser->parse($query);
    echo $creator->create($tree);

What is the expected output? What do you see instead?
Expected output: "DELETE FROM table_name WHERE column_name = 'column_value'"
error output: "
Fatal error: Call to undefined method DeleteStatementBuilder::build() in 
D:\xampp\htdocs\parser\src\PHPSQLCreator.php on line 83"

What version of the product are you using? On what operating system?
i am using the latest version, bug tested on windows 7 with XAMPP, and ubuntu 7 
with apache & php


Please provide any additional information below.




Original issue reported on code.google.com by jossanto...@gmail.com on 12 Dec 2014 at 12:29

@GoogleCodeExporter
Copy link
Author

in PHPSQLCreator.php, it should be processDeleteStatement not build

in DeleteStatementBuilder.php two function names need to be updated:

    public function processDeleteStatement($parsed) {
        $sql = $this->buildDELETE($parsed['DELETE']) . " " . $this->buildFROM($parsed['FROM']);
        if (isset($parsed['WHERE'])) {
            $sql .= " " . $this->buildWHERE($parsed['WHERE']);
        }
        return $sql;
    }

in DeleteBuilder.php, comment the foreach loop, and return $sql;

Original comment by glun...@solutionsmetrix.com on 8 May 2015 at 4:49

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