View Single Post
  #2  
Old 05-29-2017, 05:45 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How call external stored procedure before page /?target=checkout loaded?

Do you mean stored procedures?

If so, working with them will be tricky a bit. X-Cart 5 works with the database via Doctrine that is an abstraction over different database types. But stored procedures are not consistent across different types of databases, so is not something that can be implemented as an abstract thing.

However, you can use "Native Queries" to run raw SQL queries against the database:
PHP Code:
\XLite\Core\Database::getEM()->getConnection()->executeQuery('YOUR RAW SQL QUERY GOES THERE'); 

Does this work?

---

I've been told by our support staff that using the same "database handle" for regular queries and stored procedures may result into "Commands out of sync" error. If this happens to you too, you may try to use the MySQL PDO or MySQLi directly (not via Doctrine).
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions