Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi,
I have a query which generates an array from the database results returened:Code: Select all
$getrel = mssql_query('select * from products where vendor_code=151');
while($gotrel = mssql_fetch_array($getrel))
{
$relation[$gotrel[id]] = array ('id' => $gotrel[id],
'rvccode' => $gotrel[vendor_ccode],
'rvsname' => $gotrel[vendor_sname],
'rpcat' => $gotrel[prod_cat],
'rpnm' => $gotrel[prod_nm],
'rused' => '0');
}Code: Select all
$fld1 = 'rpcat';
while (list ($key, $val) = each ($relation)){
if ($relation[$key][$fld1] == 'Hardware') { $relation[$key]['rused'] = '1';
}
}Thanks
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]