Error when trying to export in Excel, filtering option doesn't work anymore

QuestionsError when trying to export in Excel, filtering option doesn't work anymore
Alexander Toth asked 6 years ago

Hello, from some time (I’ve upgraded mysql server to version 8, but I don’t know if it depends on this) there are problems with export function.

If I use the option

$opt[“export”][“paged”] = “1”;

I get an error like this:

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 ‘0’ at line 1 – SELECT * FROM elenco_reparti WHERE 1=1 ORDER BY 1 LIMIT OFFSET 0

Instead, if I use the option $opt[“export”][“range”] = “filtered”;

the export work BUT the records are NOT filtered (the entire table will be exported)

Thanks

2 Answers
Abu Ghufran Staff answered 6 years ago

Hello,

This could be due to php session reset.

When you load the grid, it keep few configration in session and when doing export, it reads from session to make export query.

Here it looks like LIMIT variable is somehow missed in query.

If you can email me code ([email protected]) i can review.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Alexander toth answered 6 years ago

Thanks Abu, this happened because I’ve inserted at the beginning of the page a third part code to handle user authentication.

Resolved by putting

session_start();

after this line:

include(PHPGRID_LIBPATH.”inc/jqgrid_dist.php”);

Your Answer

4 + 3 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?