Fixed PHP 5.3 mysqli result iteration bug