NeoPhp has problems with neoPhpExecSql - Forum

Forum Navigation
You need to log in to create posts and topics.

NeoPhp has problems with neoPhpExecSql

I've spent all week tracing a bug down that prevents one of my tasks in my app from running outside of NeoPhp's internal web server.  If I run my app with NeoPhp server, it works..  If I run it with Xamp, uWAmp, on my hosting server etc..  The task never finishes.  I figured it was probably a server setting on my side but I believe that's wrong.  It could possibly be a setting I have not found at this time, but maybe with a function created and used by NeoWeb but not my app.

I have a statement that grabs data from an sqlite database using the neoPhpExecSql function.  But the handoff to my subroutine for the function never happens on other servers.  So, I've captured the data that the function execsql is grabbing to disk on the servers that are having problems.  To my suprise, the execsql function is doing its job and grabbing the data from the server just fine!  The Json string is accurate and formed good too.

I believe the problem is in the way NeoWeb is handling the data returned after calling the neoPhpExecSql function.  It never makes it far enough to handoff the returned Json string to the subroutine in some instances.  My thoughts are string length is a possible cause.

At this point I have no way of tracing further.  Can you please look at the function your using to grab the returned data from execsql and see if a server side setting could possibly cause a problem.  If you cannot find anything, I  will try and create an app that will duplicate the behavior with the neoPhpExecSql function for you.

thanks!

 

 

Hi @darbdenral,
I don't know how to reproduce the problem you describe.
The neoPhpExecSql command is really simple. It just execute the query and returns the result as a JSON.
This is the PHP code for the SQLite database:

//SQLite
$mydb = new PDO("sqlite:".$realDbName);
$mydb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $mydb->prepare($realQuery);
$paramNum=count($parameters);
if($paramNum>0 && $params!=""){
 for($x=1;$x<($paramNum+1);$x++){
  $stmt->bindValue($x, $parameters[$x-1]);
 }
}
if(stripos($realQuery,"select")>-1){
 $stmt->execute();
 $querydata = $stmt->fetchAll(PDO::FETCH_ASSOC);
 $jsonquerydata = json_encode($querydata);
 print($jsonquerydata);
 die();
}else{
 $stmt->execute();
 print(json_encode("True"));
 die();
}

The returned info is assigned to a string variable once it's loaded into VisualNEO Web.
Do you have the problem with a specific SQL Query?

I'm quite familiar with that section of the neofunctions.php file, it's working fine..  But something is causing the handoff of the result JSON string to my assigned subroutine to fail.  Testing under current Xamp for Windows x64-7.3.9-0-VC15 fails every time..

I should be able to produce an example, it sometimes results in a discovery either way..

thanks!

It seems to be a problem specifically with Xamp..

After stripping out only the needed code to duplicate the error.  I tested with Xamp and it failed..  But I see it's working with Php Server, UwAmp and on my web hosting service too.  So I guess, something else is causing this.  Sorry for the confusion..

thanks!