I have a PHP function where I read an excel file with two columns in the A are some numbers of guides and in the B to the group (template) that you correspond example
A B
8701514 72
8701515 72
8701516 73
8701517 73
after reading the file I do two select and an update
$buss="SELECT guia FROM tablaguias WHERE guia='"$guialeida."' ";
$buscar=sqlsrv_query($conn,$buss);
if(sqlsrv_has_rows($buscar)){
$row2=sqlsrv_fetch_array($buscar);
$buss2="SELECT grupo FROM tablagrupos WHERE grupo='"$grupoleido."' ";
$buscar2=sqlsrv_query($conn,$buss);
if(sqlsrv_has_rows($buscar2)){
sqlsrv_query($conn,"UPDATE tablagrupos SET cantidad=cantidad+1 WHERE grupo='".$grupoleido."' ");
$Ok++;
}
}
Everything works perfect the problem is that with a certain group number (spreadsheet) after making the update for the first time it stays stuck, in fact when it stays that way I try to do the update in the sql directly and it also stays stuck that it has taken up to 10 minutes to do the simple update in the sql. but the same code with another group number (spreadsheet) has worked perfectly with up to 1000 records and in fact if I comment the update and only valid that they exist, it works perfectly, whatever the group number (spreadsheet).