But the problem is that I'm running a mysql_query within a while loop, which I was told I should avoid. I am using php to display the data of the two columns id & product_name in each row. Okay, here is complete code: