query("SELECT * FROM allstores WHERE barcode LIKE '%$barcode%'"); $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."."; } ?>