0

I have an codeigniter app and all data in database is coded using encrypt library.

Currently, I decrypt data in view page, but if you have 3000 results that you should return on a data table, page is very slow.

Is there any way to decrypt the data in controller ? and on the view to get directly decoded data ?

mhcrs
  • 1
  • why not use a limit query, the data displayed is only 10 or 15 rows per page. I think there will be a difference, even your data is more than 3000 – Murosadatul Feb 05 '22 at 11:47
  • 1
    if you use a data table plugin, you can see the reference here https://datatables.net/examples/server_side/simple.html – Murosadatul Feb 05 '22 at 11:56
  • it doesn't work. because same info I retrieve on dropdowns. For e.g when I retrieve customers from db, I have a select dropdown with 3000 entries that should be decrypted. – mhcrs Feb 05 '22 at 16:36
  • use select2 with Ajax (remote data) for retrive on dropdowns https://select2.org/data-sources/ajax. It's a good idea to separate the data retrieval function between the data table and the dropdown, because the data is getting more and more – Murosadatul Feb 06 '22 at 00:39
  • @Murosadatul Thank a lot for your advices. Problem solved now ! Really appreciated. – mhcrs Feb 09 '22 at 06:47
  • @Murosadatul For select2 ajax, I have an issue. Because the string is encoded in db ( ZuxKYGZpoiuVN5Vt7xLmJM9C18qxtoq9S5 ) when I search on the select2 for TEST string, it will not find it.. any hint how to solve this ? – mhcrs Feb 09 '22 at 09:14
  • I've never done it, try visiting this https://stackoverflow.com/questions/36655190/best-way-to-search-encrypted-data-inside-mysql or this https://dba.stackexchange.com/questions/23908/how-to-search-a-mysql-database-with-encrypted-fields, maybe it can provide inspiration – Murosadatul Feb 09 '22 at 09:27

0 Answers0