Reload Page Case Query Return False

0

Now, I have this query here,

$consultapedidos = mysql_query("SELECT * FROM pedidos WHERE produzido = '0'");
if(mysql_num_rows($consultapedidos)==true){
while($lnped = mysql_fetch_array($consultapedidos))
}

When it returns true I want it to list the results it finds, but if it returns false, I want it to update the page every 5 seconds until it finds a record. Anyone have any idea how I can do this?

    
asked by anonymous 04.11.2015 / 20:46

1 answer

0
$consultapedidos = mysql_query("SELECT * FROM pedidos WHERE produzido = '0'");
if(mysql_num_rows($consultapedidos)==true){
    while($lnped = mysql_fetch_array($consultapedidos)) {
    }
} else {
    echo '<meta http-equiv="refresh" content="5"/> ';
}

Basically, print the tag to update every 5 seconds, just implement it in your code in the best way.

Hope it helps

Embrace

    
04.11.2015 / 20:58