Many thanks for the response bpat but i'm still getting the same results. This is what gets displayed in the source after the script is run:
<!----
<textarea id="utmtrans">
UTM:T|12999|134.80|0.00|Atlanta|GA|USA
UTM:I|12999||0.00|0 </textarea> -
-->
I also noticed that where the $rsitemdetails["item_name"] code is displayed properly on the page this comes before it:
<?
$giftwrap="";
$reitemdetails=mysql_query("select item_name,item_code,item_price,item_qty,item_message,item_wrap,subtotal from sun_order_details where order_id=".$oid);
//echo "select b.item_name,b.item_code,b.item_price,b.item_qty,b.item_message from celebrate_item_details a,celebrate_order_details b where order_id=".$oid."<br>";
//echo "select b.item_name,b.item_code,b.item_price,a.item_message mess,b.item_qty,b.item_message from celebrate_item_details a,celebrate_order_details b where a.item_id=b.item_id and order_id=".$oid;
if(mysql_num_rows($reitemdetails)>0){
$sub_total=0;
while($rsitemdetails=mysql_fetch_array($reitemdetails)){
$item_wrap=($rsitemdetails["item_wrap"]);
?>
I tried putting the $rsitemdetails["item_name"] code elsewhere on the page just to see if it would bring it up, but it doesn't. It seems like it can only display once and that's the problem.
Sorry if i'm making this sound confusing, php definetly isn't my strong area