query("SELECT * FROM us_stores WHERE barcode LIKE '%$barcode%' ORDER BY price DESC"); $num_rows = mysqli_num_rows($result); $data = ""; if($num_rows>0) { while($row=mysqli_fetch_array($result)) { $price = $row[2]; $store = trim($row[6]); $data = number_format($price,2); $ctime = $row[5]; $dlen = strlen($store); $space = 13-$dlen; $alldata = " ".$store.str_repeat(" ",$space)."$".$data."\n".$alldata; } echo $alldata."."; } ?>