И так пробовал
...не работает
<?php
include "config.php";
mysql_connect($host, $user, $pass);
mysql_select_db($database);
$mybase = mysql_query("SELECT * FROM customers");
echo '<html>';
echo '<head>';
echo '<script language="JavaScript" type="text/javascript">';
echo 'function process(){';
echo 'okno = document.getElementById("peremenka");';
while($db = mysql_fetch_array($mybase)) {
$id = $db['id'];
$name = $db['name'];
$x = $db['x'];
$y = $db['y'];
$loc = $db['loc'];
echo "okno.innerHTML = "."'<img src=".$id.".gif id=".$name." name=".$name." style=position: absolute; left:".$x."; top:".$y."></img>';";
}
echo '}';
echo '</script>';
echo '</head>';
echo '<body onLoad="process()">';
echo '<div id="peremenka"></div>';
echo '</body>';
echo '</html>';
?>