| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Using an ID array to perform a db query | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Using an ID array to perform a db query
Hi all,
I'm trying to perform a single query to the db, in which I am using an array of IDs to insert in the WHERE clause. So far I've had mixed results, and this is the closest I've gotten to achieve what I am looking for. PHP Code:
THE RESULTS I GET (I get the actual urls): urlforid17754 urlforid17754 urlforid17755 urlforid17754 urlforid17755 urlforid17756 How can I perform the same functionality, but only retrieve the 3 urls once? Thank you all. Serge
__________________
Thanks. |
|||||||
#2
|
|||||||
|
|||||||
Re: Using an ID array to perform a db query
Ok, fixed it.
I will leave it here for anyone looking for something similar... PHP Code:
__________________
Thanks. |
|||||||
#3
|
|||||||||
|
|||||||||
Re: Using an ID array to perform a db query
Simpler to use the built-in db functions (see include/func/func.db.php) and table references ($sql_tbl):
PHP Code:
A more thorough reply might be to loop the productids and call func_get_resource_url() (see func.clean_urls.php), though that is more resource intensive, but should be fine for small lists of products. |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|