<?php 
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
	require_once "C:/Program Files/wamp/www/DressShop/cmsAdmin/lib/viewer_functions.php";

		list($uploadRecords, $uploadMetaData) = getRecords(array( 
		'tableName' => 'uploads', 
		/*'where' => 'tableName = "YOUR_SECTION_TABLE_NAME" && fieldName = "YOUR_UPLOAD_FIELD_NAME"', */
		'where' => 'tableName = "dressgallery03" && fieldName = "dress_image"', 
		'orderBy' => 'createdTime DESC', 
		'limit' => '5', 
		)); 
		$upload = @$uploadRecords[0]; // get first record 

		$recordNum = @$upload['recordNum']; // load record 
		list($dressgallery03Records, $dressgallery03MetaData) = getRecords(array( 
		'tableName' => 'dressgallery03',
		'where' => "num = '$recordNum'", 
		'limit' => '1', 
		)); 
		$dress = @$dressgallery03Records[0]; // get first record 

?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 </head>
<body>
<br />
	<?php foreach ($uploadRecords as $record): ?>  
		<a href="<?php echo $dress['_link']; ?>">
		<?php echo $dress['dress_title'] ?><br><IMG SRC="<?php echo $record['thumbUrlPath'] ?>" border="0"/>
		</a>
	<?php endforeach ?>
	
<br /><br /><br /><br />
***************************************************************************<br /><br />
***********************&nbsp;&nbsp;&nbsp; Display all the Variables &nbsp;&nbsp;&nbsp;******************************<br /><br />
***************************************************************************<br />
	
	<h2>Upload Fields</h2> 
	<xmp><?php print_r($upload); ?></xmp> 
	
	<h2>Record Fields</h2> 
	<xmp><?php print_r($dress); ?></xmp> 
	
	<hr /> 


</body>
</html>