Jump to content

Any Error In this Code...??..browser taking infinite time to refresh this..


murli800

Recommended Posts

<table >

        <tr>

            <td>Department Id</td>

            <td>Department Name</td>

            <td>Status</td>

 

        </tr>

        <tr>

        <?php while($dep = mysql_fetch_assoc(mysql_query("SELECT * FROM department"))){foreach($dep as $value)

        {?>

       

            <td><?php echo $value;?></td>

           

       

        <?php }}?>

            </tr>

 

    </table>

Don't nest all the mysql_* functions; it makes debugging a query next to impossible. The way you have it above, I don't believe it even works at all.

 

$query = "SELECT whatever FROM table";
$result = mysql_query($query);
while $array = mysql_fetch_assoc($result) ) {
     // etc.
}

Oh, it will work, returning the same row in an infinite loop. Causing the script to timeout, which is why it "takes forever".

 

Not exactly what I meant by "works" . . . :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.