View Single Post
  #3  
Old 06-12-2017, 12:42 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default 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:
$qry "SELECT clean_url FROM $sql_tbl[clean_urls] WHERE resource_id IN (".implode(',',$prodId).')';
$urls func_query_first($qry); 
func_query_column() is another good one that might be more of what you are looking for.

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.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote