I am retrieving an array of book objects with attributes like title,isbn and image. When I wish to display only labels using for loop it is displaying all entries. But when I try to display image, it only displays one. Also when I try to display both title and image, it says can
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/BookStore/BooksResult.php:14) in /Applications/XAMPP/xamppfiles/htdocs/BookStore/BooksResult.php on line 15.
Below is the code.
foreach($booksArr as &$book)
{
$content = $book->Image;
$title=$book->s_Title;
echo $title;
header('Content-type: image/jpg');
{
echo $content;
}
}
– RumpRanger
Mar 09 '12 at 20:07
'; to the code. When I run it i simply get blank boxes. When I tried running simply the url with hardcoded id, i am able to get the image. What mistake am i doing here?