Solved

I think I'm in a loop

Posted on 2007-03-23
1
175 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

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now