ghurty Posted June 30, 2009 Share Posted June 30, 2009 I have the following code to help generate a list of "vendors". I am trying to ad on though that it should also have the "vendors" logo. The path for the logo is /product_images/vendor_images/*_logo.png The * is the 'vendorid' number from the sql table. How do I tell it to pull up the vendor id# like it is pulling it up for the rest of the script, and insert into the *_logo.png. Thanks $GLOBALS['VendorLogo'] = /product_images/vendor_images/??????????? public function SetPanelSettings() { $GLOBALS['SNIPPETS']['VendorList'] = ''; $query = " SELECT * FROM [|PREFIX|]vendors ORDER BY vendorname DESC "; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while($vendor = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['VendorId'] = $vendor['vendorid']; $GLOBALS['VendorName'] = isc_html_escape($vendor['vendorname']); $GLOBALS['VendorLink'] = VendorLink($vendor); $GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor); $GLOBALS['SNIPPETS']['VendorList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('VendorListItem'); $GLOBALS['VendorLogo'] = /product_images/vendor_images/??????????? } Link to comment https://forums.phpfreaks.com/topic/164314-how-to-pull-value-from-sql-table-and-ad-it-to-a-path/ Share on other sites More sharing options...
celsoendo Posted July 1, 2009 Share Posted July 1, 2009 Don't know if I understood your question, but try this: public function SetPanelSettings() { $GLOBALS['SNIPPETS']['VendorList'] = ''; $query = " SELECT * FROM [|PREFIX|]vendors ORDER BY vendorname DESC "; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while($vendor = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['VendorId'] = $vendor['vendorid']; $GLOBALS['VendorName'] = isc_html_escape($vendor['vendorname']); $GLOBALS['VendorLink'] = VendorLink($vendor); $GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor); $GLOBALS['SNIPPETS']['VendorList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('VendorListItem'); $GLOBALS['VendorLogo'] = "/product_images/vendor_images/". $vendor['vendorid'] ."_logo.png"; } Link to comment https://forums.phpfreaks.com/topic/164314-how-to-pull-value-from-sql-table-and-ad-it-to-a-path/#findComment-866842 Share on other sites More sharing options...
ghurty Posted July 1, 2009 Author Share Posted July 1, 2009 that worked. Thanks Link to comment https://forums.phpfreaks.com/topic/164314-how-to-pull-value-from-sql-table-and-ad-it-to-a-path/#findComment-866905 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.