Hi. I have this message error (IN LOCALHOST DOES NOT OCCUR)
Couldn’t execute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) pg_tmp‘ at line 1 –
SELECT count(*) as c FROM (SELECTÂ <…fields…> .WHERE ID=) pg_tmp
In my code the clausule WHERE IS:
WHERE id =”. $_SESSION[“id”]
Before I generate the session variable like this:
if ($_GET) {
if ( isset( $_GET['id'] )) {
$_SESSION["id"]=$_GET['id'];
} else {
$_SESSION["id"]=0;
}
I’m working with de version 2.6.3 build 20190926-0831
Thank you very much for your help and for your time.
Best regards.
Hi,
Perhaps, you need to remove the first IF condition.
if ($_GET) {
…
}
Because if there is no $_GET there will be nothing in session variable.
Hi Abu, thanks for answering. The above code I posted wrong.
This is the correct one:
if ($_GET) {
___if ( isset( $_GET['id'] )) {
______$_SESSION["id"]=$_GET['id'];
___} // this key was missing
} else {
___$_SESSION["id"]=0;
}
So the sql statement always has the value for $ _SESSION [‘id’], but I keep getting the error mentioned in the original question.
Best regards.
Hi,
Another possibility may be, if you use session variable before calling session_start(); it will not read or set session vars.
Either put this code after including jqgrid_dist.php or call session_start() before this code.
If issue still remains unresolved, please send complete grid code so I can regenerate it here.