PHP PDO SQLite3 issue using "WITH" clause -


I am working on a PHP project where I have to execute the query in the SQLite3 database. I use PHP PDO for this. I am doing all my questions except for any one act as a charm. What I'm talking about is a recursive SQLite CTE.

Here is a statement:

 with  data (select1as level, id, number_of_ processor, nop, processor_type devices from pt union all select levels + 1, Data from ID, NOP, PT, Data Inner Genomes on On (Data.ID = DID) where Level & Lt; NOP) Select from ID as Processor_type ID, Level, by PTR ID, Level  

I have "SQLite Manager" (Firefox extension) Tested the statement where it works but not with PDO rather work with php_sqlite3.dll.

My environment is configured like this:

  • Windows Server 2012 R2
  • Apache website 2.4.10
  • PHP 5.4.28 for Windows

The related PHP class is:

  Use \ PDO; Use \ PDOException; Classic SQLiteDBConnector {Private $ dbname = NULL; Private $ db = null; Public function __ composition ($ dbname) {$ this- & gt; Dbname = $ dbname; $ This return; } Private Function Connect () {{$ this-> Try db = new PDO ('sqlite:' $ this- & gt; dbname)); $ This- & gt; DB- & gt; Set Attribution (PDO :: ATTRARODI, PDO :: ERRMODXEpision); } Hold (PDOException $ E) {$ $ e; }} Public function getConnection () {if (isset ($ this-> db) === incorrect) {$ this-> Connect (); } $ $ -; Db; } Public Function Query ($ stmt) {$ resultet [] = array (); {$ Conn = $ this- & gt; Try getConnection (); $ PrepStmt = $ conn- & gt; Prepare ($ sqlStmt); $ PrepStmt- & gt; Executed (); While ($ line = $ prefectmati-> get (PDF :: FETCH_ASSOC)) {$ resultet [] = $ line; }} Hold (PDOException $ e) {$ throw $ e; } Return $ $ Resultset; }}  

And this is the reply to the PDO:

  SQLSTATE [HY000]: General error: 1 with "with": syntax error  

Does anyone know why the SQLSTATE error has been thrown? Odds are good that the SQLite library is not compiled on the Windows server, support common table expression, Which were presented quite recently.

To verify the version of the Library, execute it on the server.

  & lt ;? Php print_r (SQLite3:: version ()); ? & Gt;  

This is not the same version number that you can see that you execute SQLite from the command line on the server. I think you need at least version 3.8.3.

Think about renewing PHP on the server; Current version 5.6 +.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -