| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Running Simple Selects on 3rd party table | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hello,
I would like to run some simple selects on a 3rd party table in my X-Cart 5.2 database. I tried to create an entity class and access it that way, but I noticed the X-Cart table prefix was added on so it just created a new table. Any sample code someone can share to point me in the right direction? Thanks!
__________________
X-Cart 5.3 |
|||||||
#2
|
|||||||
|
|||||||
![]() Not sure if this is the best solution, but it works for MySQLi:
Code:
Hope that helps!
__________________
X-Cart Gold 4.4.5 X-Cart Ultimate 5.2.22 X-Cart Business 5.3.2.13 X-Payments 3 |
|||||||
#3
|
|||||||
|
|||||||
![]() I should also note you need to make sure to initialize X-Cart 5 by including top.inc.php if you're running this outside of the X-Carts's object model in your own PHP file:
Code:
__________________
X-Cart Gold 4.4.5 X-Cart Ultimate 5.2.22 X-Cart Business 5.3.2.13 X-Payments 3 |
|||||||
#4
|
|||||||
|
|||||||
![]() Thank You! It Works!
__________________
X-Cart 5.3 |
|||||||
#5
|
|||||||||
|
|||||||||
![]() You can execute raw MySQL queries like this:
Code:
You should not use this for X-Cart 5 database tables (and use ORM instead), but it is OK to use this for non-X-Cart-5 tables in the same database.
__________________
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 |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|