Thanks for the suggestion but I'm still stuck. No error message this time so i'm assuming that it's not just the query syntax. Instead, now the script fails with no output beyond the line where the $db->Execute occurs.
PHP Code:
for ($c=0;$c<= count($imageFiles);$c++){
$prodImgName = str_replace("_LRG","",$imageFilePaths[$c]);
$prodImgName = str_replace("images/large/","",$prodImgName);
$prodId_query = "SELECT p.products_id FROM " . TABLE_PRODUCTS . " p WHERE p.products_image LIKE '" . $prodImgName . "' AND p.products_status = '1'";
$thisProdId = $db->Execute($prodId_query);
echo $thisProdId. "<br />";
}
Since it looks like you'll need more background info on what i'm trying to do, here goes:
I have created a new custom define page. in it, i'm using php to pull up a list of all images that exist in the "images/large" directory and would like to display them as a list of textual links.
Got it working except for i'm now trying to grab/match the product Id for those products whose image has a large version. Of course, the large images directory contains many images for which there directly are no products (as some prods have multiple images and the naming convention for those will not match up - and some images may exist where a product has been deleted or not yet created ...but that's okay) I only need to find the prod id for those images that have a valid matching database entry.
Bookmarks