URL Not matching up?

I have this code that puts content into TinyMCE. I have defined the URL, but for some reason, when it adds the image into TinyMCE, it takes off $path and just leaves “/images/upload_pic/” in the coding. Basically, it puts in the code where the image is from where the editor file is saved.

Any suggestions?

			  $path = "http://www.askassociatesconsulting.com/";
			  $local = "Heriyah/admin/images/upload_pic/";
			    $query0  = "SELECT time, imagepath FROM images";
  $result0 = mysql_query($query0);

while(list($time, $imagepath)= mysql_fetch_row($result0))
{
		echo "<a href=\"#\" onclick=\"tinyMCE.execCommand('mceInsertContent',false,'<b><img src={$path}{$local}{$time}-{$imagepath}></b>');return false;\"><img src=\"{$path}{$local}{$time}-{$imagepath}\" width=\"50px\" height=\"50px\"></a>";
		}