mathus Posted July 2, 2007 Share Posted July 2, 2007 by the level to which this issue is irritating me, it must be something simple. All im trying to do is a simple SELECT query. nothing strange about it. $sql = "SELECT wdate, wtype, wreason, wmemo FROM empwarn WHERE l_name = '$name'"; $res = mysqli_query($mysqli, $sql); if($res == true) { $list = mysqli_fetch_array($res); while($list) { printf("<td>".$list['wdate']."</td> <td>".$list['wtype']."</td> <td>".$list['wreason']."</td> <td>".$list['wmemo']."</td> </tr>"); } } thats it. but when i run the query i get this: The connection was reset The connection to the server was reset while the page was loading. anybody have an idea where to look?? Quote Link to comment Share on other sites More sharing options...
trq Posted July 2, 2007 Share Posted July 2, 2007 This... while($list) { printf("<td>".$list['wdate']."</td> <td>".$list['wtype']."</td> <td>".$list['wreason']."</td> <td>".$list['wmemo']."</td> </tr>"); } Is an infinant loop because $list will always be true. You need to use.... while($list = mysqli_fetch_array($res)) { printf("<td>".$list['wdate']."</td> <td>".$list['wtype']."</td> <td>".$list['wreason']."</td> <td>".$list['wmemo']."</td> </tr>"); } Quote Link to comment Share on other sites More sharing options...
mathus Posted July 2, 2007 Author Share Posted July 2, 2007 Thank ya much, i knew it would be something simple. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.