$query = "SELECT * FROM `service_packages` WHERE `username` = '" . mysql_real_escape_string( $_GET["act"] ) . "' ORDER BY `pkg_name` "; $result=mysql_query($query) or die(mysql_error()); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id = htmlentities(mysql_result($result,$i,"id")); $pkg_name = htmlentities(mysql_result($result,$i,"pkg_name")); $pkg_price = htmlentities(mysql_result($result,$i,"pkg_price")); $pay_period = htmlentities(mysql_result($result,$i,"pay_period")); echo ('  '.$pkg_name.' $'.$pkg_price.' '.$pay_period.' '); $i++; }