$row is an array, but you are attempting to use it as an index. I suspect you just want to write:
$itemname[$i][] = $row;
EDIT:
Sorry, my above solution is not quite what you asked for. However, upon some reflection, I think you should try something along these lines:
$result = mysql_query("SELECT category, itemname, itemprice FROM items WHERE category BETWEEN 1 AND 32");
$itemname = array();
$itemprice = array();
while ($row = mysql_fetch_assoc($result))
{
$itemname[$row['category']][] = $row['itemname'];
$itemprice[$row['category']][] = $row['itemprice'];
}