No it returns a mixed assoc and regular array.
SELECT one, two, three FROM table;
gives
Array (
[0] => 'oneValue',
['one'] => 'oneValue',
[1] => 'twoValue',
['two'] => 'twoValue',
[2] => 'threeValue',
['three'] => 'threeValue'
);
With regard to your problem it stems from poor design, having multiple values in one field is bound to cause problems, you should have another table, that's how relational databases work. However, if redesigning the database is not an option then we must find another way around. The easiest way (and probably the fastest, but I'll leave you to do the benchmarking) i think will be to do it in the SQL. Right, let's go.
You want one of the | seperated values in 'catid' to be equal to $catid and the 'fabid' to be equal to $srow['id'] (you should always place quotes around your array key's), let's see what we get.
SELECT * FROM products WHERE fabid='".$row['id']."' && catid REGEXP "(||)\d+(||$)" order by rand() limit 1
Let's explain the regex
"(" : Group the first alternation (the | )
"" : match the begining of the string
"|" : OR
"|" : Escaped special character means the literal string
")" : close the grouping
"\d" : A digit
"+" : one or more times
"(" : Group the second alternation
"|" : same
"|" : same
"$" : match the end of the string
")" : same
One thing you should not is that REGEX takes a lot more work than doing a straight equals (it takes even more than doing a LIKE) so you should do an explain on the query to get the stats on it and then try to optimize it as much as possible. Also, you should try to do it a similar way as you have started below and then benchmark the two because, depending on your data getting PHP to analyze it may be quicker.
HTH
Bubble