Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loaddata.php patch #49

Open
yellperil opened this issue Aug 8, 2017 · 0 comments
Open

loaddata.php patch #49

yellperil opened this issue Aug 8, 2017 · 0 comments

Comments

@yellperil
Copy link

I had an issue with loaddata.php

patch loaddata.php < patch.txt

save between SNIP (but do not include SNIP as patch.txt, Or find the - lines and replace them with + lines.
===> SNIP <===
--- loaddata.php.original.broken 2017-08-02 00:56:32.000000000 +0930
+++ loaddata.php.fixed 2017-08-08 15:47:37.000000000 +0930
@@ -75,10 +75,10 @@

$query = 'SELECT *, date_format(lastvisit, "%d/%m/%Y") as lastvisit FROM '.$mydb_tablename ;
$queryCount = 'SELECT count(id) as nb FROM '.$mydb_tablename;

-$totalUnfiltered =$mysqli->query($queryCount)->fetch_row()[0];
-$total = $totalUnfiltered;

+//m3f $totalUnfiltered =$mysqli->query($queryCount)->fetch_row()[0];
+//m3f $total = $totalUnfiltered;
+$totalUnfiltered =$mysqli->query($queryCount)->fetch_row();
+$total = $totalUnfiltered[0];

/* SERVER SIDE /
/
If you have set serverSide : true in your Javascript code, $_GET contains 3 additionnal parameters : page, filter, sort
@@ -98,7 +98,9 @@
$filter = $_GET['filter'];
$query .= ' WHERE name like "%'.$filter.'%" OR firstname like "%'.$filter.'%"';
$queryCount .= ' WHERE name like "%'.$filter.'%" OR firstname like "%'.$filter.'%"';

  • $total =$mysqli->query($queryCount)->fetch_row()[0];
    +//m3f $total =$mysqli->query($queryCount)->fetch_row()[0];
  • $totalUnfiltered =$mysqli->query($queryCount)->fetch_row();
  • $total = $totalUnfiltered[0];
    }

if ( isset($_GET['sort']) && $_GET['sort'] != "" )
===> SNIP <===

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant