That looks much better. Thanks for the change.
2 VERY tiny improvements you could make:

- you do not need to specify 4th parameter in queryDB to be true since it is true by default
- not sure if you reuse your $sql_query variable. If not then you can paste the value directly into queryDB e.g. queryDB("SELECT ....", ...)