Onclick event for image tag inside PHP echo, is not working
<p>In my image.php file i have code</p>

<pre><code>$id=abs($_GET['id']);
$query = mysql_query("SELECT image FROM table1 WHERE id=$id");
$data=mysql_fetch_array($query);

header('Content-type: image/jpg');
echo $data['image'];
</code></pre>

<p>And while retrieving i am using query</p>

<pre><code>$query = mysql_query("SELECT id FROM table1");
  while($data=mysql_fetch_array($query)) {
  echo '&lt;'.'img src="image.php?id='.$data['id'].'"&gt;';
</code></pre>

<p>It is perfectly displaying images from my data base...
But i want to detect which image user clicked for that i tried </p>

<pre><code>echo '&lt;'.'img src="image.php?id='.$data['id'].'" onclick="doSomething()"&gt;';
</code></pre>

<p>this onclick java script function doesn't getting call..(i am using mozilla fire fox)
I am new to PHP.  </p>

<p>Finally I need to detect the clicked image among the images which are displayed using PHP echo from Mysql.Is there any other way that i can follow for this?</p>
