Jump to content
php.lv forumi

Lekasana pa loop


Blitz

Recommended Posts

Man ir sads loops:

 

foreach ($masivs as $value)
{

       $row=ibase_fetch_row($result);
       
       if ($value==$row[0]){continue; }
       elseif ($value>$row[0]) {echo "$value<br>"; continue; }
       else 
      {
        $row[0]=ibase_fetch_row($result);
       

       }
}

 

Man vajag lai vins panem nakamo rindu no db saglabajot to pasu masiva elementu

$value. Tur kur ir $row[0]=ibase_fetch_row($result) vinam japarlec uz IF, lai parbauditu to pasu $value bet ar nakamo rindu. Ja lieto continue tad vins parlec uz foreach sakumu un panme jau nakamo masiva elementu....

Link to comment
Share on other sites

driizak gan taisi taa lai paarbaude buutu pret ieprieksejo rindu, kuru vari saglabaat iepriekseejaa iteraacijaa kaadaa mainiigajaa.

 

vai visu vispirms sakraamee ieks masiiva un tad skaties naakoso rindu.

 

bet vispaar iisti nesapratu jautajumu :)

Edited by v3rb0
Link to comment
Share on other sites

×
×
  • Create New...