Hello. I'm sort of new to PHP, but I'm in need of assistance with a WHILE loop statement. This is what I'm trying to do. Visitors who are interested in downloading a digital product from me, must first create a member account. A product link for that particular download is automatically placed in their Download Management area once the new account is created. I'm wanting the PHP script to also place product links for other digital products I label as "Free" in their Download Management area too. Here's what I have. $result = mysql_query("SELECT * FROM products WHERE itemStatus='free' ORDER BY 'added' DESC") or DIE("Could not Select from products"); while ($data = mysql_fetch_assoc($result)) { $itemId = $data['itemId']; $itemName = $data['itemName']; $result1 = mysql_query("SELECT * FROM filename WHERE itemId='$itemId' LIMIT 1") or DIE(mysql_error()); $data1 = mysql_fetch_assoc($result1); if (mysql_num_rows($result1) > 0) { $itemId = $data1['itemId']; $fileId = $data1['fileId']; $resell = $data1['resell']; if ($resell == 'NO') { $type = 0; } else { $type = 1; } } $result2 = mysql_query("INSERT INTO downloads SET custId='$custId', orders='$orders', itemId='$itemId', fileId='$fileId', prod_fileName='$itemName', download_maxdays='$download_maxdays', download_maxcount='$download_maxcount', datedl='$datedl', ipaddr='$ipaddr', type='$type'") or DIE(mysql_error()); $downId = mysql_insert_id(); } The above does work, but there is one problem. If the digital product they initially created their account for is "Free", the above While statement places a second entry for it in their Download Management. Is there anyway of saying... If product X already exists for the Customer in the Downloads Table, then skip this row, returning to the top of the While loop looking for any other "Free" files to add. Can someone help? Hope I explained this well enough.