PHP Classes

I added a prepareQuery method to ensure no backticks or singl...

Recommend this page to a friend!

      Light PHP SQL Parser Class  >  All threads  >  I added a prepareQuery method to...  >  (Un) Subscribe thread alerts  
Subject:I added a prepareQuery method to...
Summary:Package rating comment
Messages:2
Author:King Goddard
Date:2020-09-28 20:00:08
 

King Goddard rated this package as follows:

Utility: Good
Consistency: Good
Documentation: Good
Examples: Good

  1. I added a prepareQuery method to...   Reply   Report abuse  
Picture of King Goddard King Goddard - 2020-09-28 20:00:08
I added a prepareQuery method to ensure no backticks or single and double quotes are in the string. Otherwise the parse will fail to find fields and other items.

/**
* Remove backticks, single and double quotation marks.
*/
public function prepareQuery() {
$this->query = str_replace('`', '', $this->query);
$this->query = str_replace('"', '', $this->query);
$this->query = str_replace("'", '', $this->query);
}

  2. Re: I added a prepareQuery method to...   Reply   Report abuse  
Picture of Marco Cesarato Marco Cesarato - 2020-09-29 16:23:29 - In reply to message 1 from King Goddard
Than you for your contribute, just updated the class with these improvement