Fwrite from a recordset do while loop
I must be missing something. I'm trying to write an XML file to the server with a loop that reads from a dataset. The write works fine, but I'm not getting any data from my loop. My syntax is wrong I'm sure, but I'm lost on how to make this work. Looking for a friendly helping hand. :)
<?php
$fp = fopen('testxml.xml', 'w');
fwrite($fp, '<?xml version="1.0" encoding="UTF-8"?>');
fwrite($fp, '<gallery imagesFolder="photos/" thumbnailsFolder="thumbnails/" numRows="3">');
?>
<?php do {
fwrite($fp, '<img src="$row_Recordset1['image1']" width="600" height="400" title="$row_Recordset1['description']"/>');
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
?>
<?php
fwrite($fp, '</gallery>');
fclose($fp);
?>