Login   Register  
PHP Classes
elePHPant
Icontem

Infinite Loop Problem

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      guaranix Rank  >  All threads  >  Infinite Loop Problem  >  (Un) Subscribe thread alerts  
Subject:Infinite Loop Problem
Summary:If a node without inbound link exists $formula never updates
Messages:2
Author:omer ilhan
Date:2008-06-23 10:56:07
 

  1. Infinite Loop Problem   Reply   Report abuse  
Picture of omer ilhan
omer ilhan
2008-06-23 10:56:07
Hi,
In the preperation step if a node do not have inbound links

$Sql = "select pagerank.master, tmp_pr.nroout from pagerank inner join tmp_pr on (tmp_pr.id = pagerank.master) where pagerank.slave = ".$row['id'];

do not return any value.

$formula is updated according to the result of the above query so it is empty.

all the rows in tmp_pr whose formula value is empty are selected in a loop and so this process is never ends

  2. Re: Infinite Loop Problem   Reply   Report abuse  
Picture of alexey
alexey
2014-09-02 14:37:28 - In reply to message 1 from omer ilhan
solution is replace:
$formula = "";

by:
$formula = "";
if (mysql_num_rows($xSql) == 0) {
$formula .= "0 + ";
}