0

Welcome

I have some problem wits code. Could u help me? i search for the Ethernet but i don't found same example. Below error code:

Notice: Undefined variable: i in /reklamacje/index.php on line 72

The problem / error line - $i=$i+1;

I know that i need some isset option.. or something else ?

More code:

foreach ($dbo->query($query) as $row) {
$m=$i%2; // required for alternate color of rows matching to style class 
$i=$i+1;   //  increment for alternate color of rows
echo "<tr>";
        echo "<td>".$row['od_firma']."</td>";
                echo "<td>".$row['nr_narzedzia']."</td>";
                echo "<td>".$row['nr_faktury']."</td>";
                echo "<td>".$row['data_przyjecia']."</td>";
                echo "<td>".$row['data_wyslania']."</td>";
                echo "<td>".$row['opis_rek']."</td>";
                echo "<td>".$row['kto_rozpatrzyl']."</td>";
                echo "<td><a href=\"index.php?a=dodaj&amp;id={$row['id']}\">Dodaj</a></td>";
        echo "<td><a href=\"index.php?a=edit&amp;id={$row['id']}\">Edytuj</a></td>";
                echo "<td><a href=\"index.php?a=del&amp;id={$row['id']}\">Usuń</a></td>";

        echo "</tr>";
    }
    echo "</table><br><br>";
////////////////////////////// End of displaying the table with records ////////////////////////

/////////////////////////////// 
if($nume > $limit ){ // Let us display bottom links if sufficient records are there for paging

/////////////// Start the bottom links with Prev and next link with page numbers /////////////////
echo "<table align = 'center' width='50%'><tr><td  align='left' width='30%'>";
//// if our variable $back is equal to 0 or more then only we will display the link to move back ////////
if($back >=0) { 
print "<a href='$page_name?start=$back'><font face='Verdana' size='2'>PREV</font></a>"; 
} 
//////////////// Let us display the page links at  center. We will not display the current page as a link ///////////
echo "</td><td align=center width='30%'>";
$i=0;
$l=1;
for($i=0;$i < $nume;$i=$i+$limit){
if($i <> $eu){
echo " <a href='$page_name?start=$i'><font face='Verdana' size='2'>$l</font></a> ";
}
else { echo "<font face='Verdana' size='4' color=red>$l</font>";}        /// Current page is not displayed as link and given font color red
$l=$l+1;
}


echo "</td><td  align='right' width='30%'>";
///////////// If we are not in the last page then Next link will be displayed. Here we check that /////
if($this1 < $nume) { 
print "<a href='$page_name?start=$next'><font face='Verdana' size='2'>NEXT</font></a>";} 
echo "</td></tr></table>";

// end of if checking sufficient records are there to display bottom navigational link. 
}

How to change it ?

Greeting for all help information.

2
  • Hint: Place $i=0; above foreach ($dbo->query($query) as $row) loop. Sep 30, 2015 at 12:44
  • Working !!! Thank You! Sep 30, 2015 at 13:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.