tearing my hair out

topic posted Mon, July 2, 2007 - 7:04 AM by  shawn
everything in this script seems correct, and ive tried it so many ways, using different commands, with and without use_result, but when i try to get it to output to screen, the server times out. Its localhost, and i'm the only one accessing it. i just don't get it.

$sql = "SELECT wdate, wtype, wreason, wmemo FROM empwarn WHERE l_name = '$name'";
$res = mysqli_query($mysqli, $sql);
if($res == true) {
echo "good";
$num = mysqli_num_rows($res);
echo $num;
$list = mysqli_fetch_array($res);
mysqli_use_result($list);
while($list) {

echo "<td>".$list['wdate']."</td><td>".$list['wtype']."</td><td>".$list['wreason']."</td><td>".$list['wmemo']."</td></tr>";

}


}
posted by:
shawn
Boston
  • Re: tearing my hair out

    Thu, July 5, 2007 - 1:47 AM
    Assuming you don't have a debugger to run through the code with, a simple solution would be to add a flush() after every echo so that you can see how far you get in the script. If the while loop isn't terminating, you should see that easily enough.

Recent topics in "PHP Developers"

Topic Author Replies Last Post
using dreamweavers PHP Jivatma 2 August 4, 2008
Another question about formatting date & time SMSapphire 6 June 7, 2008
phpews Satinder 0 June 4, 2008
how works with joomla ??? iShaun 1 May 22, 2008