0

i created while loop in php but it is gone infinite-the c

 <table width="100%" align="center">      
                                                    <tr>
                    <td align="center" width="100%">
                        <table  width="95%"  border="1px"  cellspacing="1" cellpadding="4">
                                                    <tr>
                                                        <?php 
                                                        $count=1;
                                                        $columns=$no_of_days+2;
                                                        while($count<=$columns)
                                                        {
                                                            if($count=1)
                                                            {
                                                                echo "<td colspan='5'>Owner Name</td>";
                                                            }
                                                           if ($count=2) {
                                                            echo "<td colspan='5'>Unit Name</td>";
                                                            }
                                                            if ($count>2) {
                                                                $cdate=$count-2;
                                                                echo "<td>".$cdate."</td>";
                                                            }
                                                           $count++;
                                                        }
                                                        ?>





                            </tr>
                                                </table>
                                            </td>
                                </tr>
                        </table>
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by daniel36
1

In lines 11 and 15 you're assigning to $count, not comparing it.

Edited by deceptikon

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.