I noticed that Message-ID: <4qu821t0i37mfjp0jjsb54cfgtu6ls79am@4ax.com>
from Michael Fesser contained the following:
[color=blue][color=green]
>>Each product has a few other products with
>>which it can be combined. In the 'combination'-
>>field is an array of 3 other id's the product
>>can be combined with. (e.g. 78-34-94)[/color]
>
>Broken design. Use another table for the combinations of products, don't
>put multiple informations into a single field (keyword: normalization).[/color]
Correctly normalising the data would be best but actually it would be
possible to do what he wants to do, provided he was consistent in the
way he stored the data. You would just explode the field into an array
and then produce the links from the array values.
$comb_id = explode("-", $myrow['combination']);
for ($i=0;$i<count($comb_id);$i++){
echo"<a href=\"lookuppage.php?id=".$comb_id[$i]."\">Combination
$i</a><br>\n";
}
Then in lookuppage.php use $_GET[id] as the basis of a query.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs
http://www.ckdog.co.uk/rfdmaker/