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 |
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:
|
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. |
All times are GMT -8. The time now is 08:13 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.