From 61ddf0a32846fdf2607043d94af1a0a86b80f6fc Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Mon, 12 Aug 2002 12:42:42 +0000 Subject: Bug 43600 - Convert products/components to use ids instead of names. Initial attempt by jake@bugzilla.org, updated by me r=joel, preed --- queryhelp.cgi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'queryhelp.cgi') diff --git a/queryhelp.cgi b/queryhelp.cgi index 89db7b5cb..16acf73f1 100755 --- a/queryhelp.cgi +++ b/queryhelp.cgi @@ -660,7 +660,7 @@ print qq{ }; -SendSQL("SELECT product,description FROM products ORDER BY product"); +SendSQL("SELECT name, description FROM products ORDER BY name"); while (MoreSQLData()) { my ($product, $productdesc) = FetchSQLData(); @@ -725,7 +725,11 @@ components and their associated products: foreach $product (@products) { - SendSQL("SELECT value,description FROM components WHERE program=" . SqlQuote($product) . " ORDER BY value"); + SendSQL("SELECT components.name, components.description " . + "FROM components, products " . + "WHERE components.product_id = products.id" . + " AND products.name = " . SqlQuote($product) . + "ORDER BY name"); while (MoreSQLData()) { -- cgit v1.2.3-24-g4f1b