2
I’m having a problem doing a query in a Mysql database. This query returns me a lot of data, and this data is sent to make a comparison within a while
. Usually it is exceeding the time of my server finishing the execution before making all the comparisons.
I want to know if you have a technique for comparing all records without the execution being interrupted?
It is possible for a progress bar or a percentage to know how much has already been processed?
Below is part of the code I’m using for better understanding.
while($row=ibase_fetch_object($result)){
$codigo = $row->CODIGO;
$saldo = $row->SALDO;
$mysqlquery = mysql_query("SELECT * FROM especificacoes_do_produto WHERE edp_interno LIKE '$codigo'");
if(mysql_num_rows($mysqlquery) != 0){
mysql_query("UPDATE especificacoes_do_produto SET edp_estoque = '$saldo' WHERE edp_interno='$codigo'");
$cad_texto = "Atualizado.....";
} else {
$cad_texto = "cadastrar";
}
}
I think your question would be: how to set the running time of a PHP script?
– Luitame
Have to show the code of the Firebird/inter base query, maybe it is possible to optimize it.
– rray
yes this is the sql I’m using.. $sql = "SELECT DISTINCT (items.codigo), items.codigofabricante, items.Descricao, items.fabricante, items.um, (select balance from saldoiten(12,items.codigo,null)) the items balance FROM items items, itensorcamentos io WHERE items.CODIGO = io.ITEMESTOQUE and (items.codigo BETWEEN '100000' AND '39999999') AND (io.DATAINCLUSAO Between '$date $hora_inicio' And '$date $hora_fim') AND (io.FILIAL=12) ORDER BY items.codigo"; @rray
– Adrianoecris