PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hi ok i am working with mySQL; pulling images into a table, i have the files showing correctly on one page, but not on this page.. i don't know why. all i get are broken images. heres what i am using
Can you post what outputs you are getting - what are the locations of the broken images? There are hundreds of reasons that this could not be working for u.
Klavier wrote:hi ok i am working with mySQL; pulling images into a table, i have the files showing correctly on one page, but not on this page.. i don't know why. all i get are broken images. heres what i am using
$query = "SELECT image_url FROM table WHERE id = '{$id}'";
$result = mysql_query($result) or die (mysql_error());
while ($array = mysql_fetch_array($result))
{
print "<img src=\"images/{$array['image_url']}\">";
}
like ~d11wtq said, all you're doing is dumping binary data to the browser. Unless proper headers are sent, it's not going to know what to do. Your best bet is to have a special image outputing page that attaches the appropriate headers along with the binary data.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.