query("SELECT * FROM allstores WHERE barcode = '$barcode' ORDER BY productname"); $num_rows = mysqli_num_rows($result); if($num_rows>0) { while($row=mysqli_fetch_array($result)) { if(strlen(trim($row[1]))query("SELECT * FROM notfound WHERE barcode = '$barcode'"); $num_rows = mysqli_num_rows($sql); if($num_rows==0) { $sql = "INSERT INTO notfound (barcode,ctime) VALUES ('$barcode','$date')"; if (!mysqli_query($mysqli, $sql)) echo ""; } } ?>