Get URL Variable php send it to SWFOBJECT

Hello all
Been battling with this for a little while and am very close. Hoping someone can help me fill in the final piece I need here.
I’m retrieving a url variable with php. I am trying to send the name of a picture to swfobject variable in order to display a picture in a flash zoom script.

<div id="zoom"></div>


$links = mysql_connect("localhost", "Username", "XXXXXX")  ;

$id="The current id is not a number!";


$query = "select * from links where id='$id'";

$results = mysql_query($query)or die("Query error

while ($line = mysql_fetch_assoc($results)) {
echo $line['description'];


	echo $id;

<script type="text/javascript">
        // <![CDATA[
            var so = new SWFObject('zoom.swf', 'zoom', '600px', '600px', '8', '#CCCCCC');
			so.addVariable("image", "<?php echo $line['image'] ; ?>"); 
		// ]]>


The description Text pulls up fine and I can reference the rest of the info in the row no problem just stuck on getting it into the flash file now. Anyone had experience with this before? I’m assuming it’s because I’m closing the php script before I’m retrieving the variable but I can’t seem to include the Javascript in echo I tried that with no love.