Solved

I think I'm in a loop

Posted on 2007-03-23
1
180 Views
Last Modified: 2010-07-27
Have I put myself into a loop here?

<?php
$i = 0;
while ($i < 2) {
      $i = $i+1;
      if ($i=1) {
            echo "<tr>";
      }
      echo "<td>";
?>
<form action="/admin/delete_provider.php?Company=<?= $strCompanyname ?>" method="post">
  <td width="250">
     <a href="/admin/edit_provider.php?providerID=<?= $providerID ?>" >
       <?= $strCompanyname ?>
     </a>&nbsp;
     <a href="/admin/confirm_provider.php?Company=<?= $strCompanyname ?>">
       <input type="button" value="Delete" class="btn2">
     </a>
   </td>
</tr></form>
<?php
 echo "</td>";
      if ($i=3) {
            echo "</tr>";
            $i=0;
      }
}
?>
0
Comment
Question by:pingeyeg
1 Comment
 
LVL 5

Accepted Solution

by:
Trakos earned 500 total points
ID: 18781710
You have wrong if syntax. You should use == (compare) instead of = (change value).
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question