im currently running multiple mysql querys but want to just run one and loop through it. how can i improve this
$query = mysql_query("SELECT productid, code, size, quantity, sizechart, rprice, price, weight FROM inventory WHERE code = '$productcode1'");
while ($rows1 = mysql_fetch_array($query))
{
$productids1 = $rows1['productid'];
$codes1 = $rows1['code'];
$sizes1 = ucwords($rows1['size']);
$quantitys1 = $rows1['quantity'];
$sizechart = $rows1['sizechart'];
$rprice = $rows1['rprice'];
$sprice = $rows1['price'];
$dweight = $rows1['weight'];
}
each query then carrys on the same, but $productcode2 and $productcode3 etc.