umm
if($dbstate == 1){
$img = "on.gif";
}else{
$img = "off.gif";
}
echo "<img src=\"".$img."\">";
If you need the browser to update without any interaction you'd need a meta refresh in the page.
Hmm, or do you mean that completely different websites to yours have the icon? If so then you would need their webserver to allow server-side includes and put a URL to your script in place of the image, and your script would return the correct image depending on database values. I guess this also means that PHP needs to run as CGI. Ho-hum.