SteemWatcher Portal Development " Server Side Searching Module ".

in hive-151113 •  2 years ago 

Hello Steemians,

20230906_122908_0000.jpg

There are two types of searching technique that we use to for search module. Some day ago, we have develop the search module that is base of client side. The searching module work on the client retrive data. We are using pagination and display 100 table rows in one page.

The issue that we are facing is, once we search any report of user then it search on the base of pagination. I try to explain in simple words. 100 table rows show in one page then search module is only perform the searching on just 100 rows that is not a good technique. But main advantages of client side searching its responsiveness. Its response is faster as compare to server side searching. It does not depenf on server performance and result can be displayed immediately

In client side, we retrive the whole data into variable and show on client screen in parts using pagination technique.

The previous code that we use for client side searching.

  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<script>
$(document).ready(function() {
    $("#search").on("keyup", function() {
        var searchText = $(this).val().toLowerCase();
        $("table tbody tr").filter(function() {
            $(this).toggle($(this).text().toLowerCase().indexOf(searchText) > -1);
        });
    });
});


Many issue are facing for report data validation with the above code. Now we developed the searching module that will work on server. We a user initiate any search query then a request will send to server and get the response back from server. This technique take some time as compare to client side searching.

Reports data on our portal is increasing day by day. Data volume is increasing continuesly, so we change our searching technique to get the secure and accurate data.

Screenshot_20230906-121041~2.png

Screenshot_20230906-121115~2.png


<?php

//Getting value of "search" variable from "script.js".
if (isset($_POST['search'])) {
//Search box value assigning to $Name variable.
   $Name = $_POST['search'];
//Search query.
   $Query = "SELECT * FROM `steem _watcher_reports` WHERE `USER_ID` LIKE '%$Name%' ";
//Query execution
   $ExecQuery = ($conn->query($Query));
          
// Show data in the form of data .
                                                              
<?php

   while ($Result = MySQLi_fetch_array($ExecQuery)) {
       ?>
   
   <div onclick='fill("<?php echo $Result['USER_ID']; ?>")'>
                                    


Please cast witness vote to bangla.Witness or set proxy to rme.

_
Vote bangla.witness as witness
Set Proxy rme as proxy

Special Thanks.

Cc: @rme
Cc: @hungry-griffin
Cc: @steemcurator01
Cc: @steemchiller
Cc: @pennsif

Thanks for giving your precious time to my post.
Follow | Upvote | Share | Comments
Follow me on Instagram.
Instagram

🆃🅷🅰️🅽🅺 🆈🅾️🆄

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!