View Single Post
  #1  
Old 10-01-2015, 12:39 PM
 
cleverwise cleverwise is offline
 

Advanced Member
  
Join Date: Jun 2014
Posts: 74
 

Default Database Queries In Functions?

Does anyone know the best way to execute SQL queries inside a function call?

I need to query the database get results then process data from query A to build query B. Then once done I will return the results by leaving the function call.

I am not sure of the safest way to query the database that won't break with X-Cart upgrades. I can't find a developer help document at http://kb.x-cart.com/ explaining the ways on working with database SQL queries in function calls.

Any thoughts?

Thank you!

For example:

Code:
protected function doNoAction() { // Execute query A and get results // Now read queried results and build query B then run that query return $var1; }
__________________
Respectfully,

Jeremy

X-Cart 5.3 running on:
* Web server: Nginx with PHP-FPM via FastCGI (Opcache enabled)
* Database: Percona Server
* OS: CentOS
Reply With Quote