Question: I am trying to get the step number to increase with each step that is pulled from the database. Here is my code:

```
//get the project steps 
$ID=mysqli_real_escape_string($con,$_GET['id']);         
      $projSteps="SELECT project_steps.projectStepDesc,project_steps.projectID FROM project_steps WHERE project_steps.projectID=$ID";  
    $results1 = mysqli_query($con,$projSteps);  
    if (!$results1) {
printf("Error: %s\n", mysqli_error($con));
exit();
}   
       if (mysqli_num_rows($results1) > 0){
        echo '<h2>Project Steps:</h2>';           

 while ($rows = mysqli_fetch_assoc($results1))
    {
      $a=1;
      echo "Step ". $a++ ."<br />";
      $psteps=$rows['projectStepDesc'];
      echo '<div id="steps">';
      echo "$psteps";
      echo '</div>';
      }}//end project steps

```

This just outputs Step 1 on each step. I am trying to get it to say Step 1, Step 2, Step 3 ect. How can i do this?

Answer: 
You're declaring the counter inside the while loop. This won't work as, `$a = 1;` is called each time you loop through and do something. Change:

```
while ($rows = mysqli_fetch_assoc($results1))
    {
      $a=1;

```

To:

```
$a=1;
while ($rows = mysqli_fetch_assoc($results1))
    {

```
You're setting `$a = 1` within your loop each time. Put it outside the loop.