Hello,
I can not make this query work in phpgrig.
The query works fine when it’s called in a MySQL tool like SQLyog
http://rextester.com/LOV64823
With phpgrid it always returns the error right syntax to use near ”\nf_nt4 … I have tried several options but can’t make it work.
Do you have any tips to fix this?
Thanks,
Cedric
There seems to be some limitation in escaping function of library.
One way to solve it is by escaping \ character again: e.g.
$g->select_command = str_replace(‘\\’,’\\\\’,$g->select_command);
This will skip the error. However when it comes to rendering, grid will remove \ character again as it assumes it as escaped character. To fix display edit lib/inc/jqgrid_dist.php and remove these lines:
foreach($row as $k=>$r)
$row[$k] = stripslashes($row[$k]);
ok thanks for the tips. I will look in creating a view in Mysql to avoir editing your library.
Hello Abu,
I am still stuck with this.
Can you hekp me in fixing the escape characters?
This does not work:
$g->select_command = str_replace(‘\\’,’\\\\’,$g->select_command);
nor this
$g->select_command = str_replace(‘\\’,’\\\\’,$sql);
Thanks,
Cedric
Here is working demo code:
https://gist.github.com/gridphp/59449c4a5cbcd3fb8ce555b4992f565b#file-cedric-slash-demo-L22
I’m also emailing you updated build.
thank you Abu, it is working fine now.