title: error outputting html with javascript
body: <p>I have this php code, with which I am trying to generate a popup window that will contain the contents of a html file, however after adding in the script tags, no html is displayed. I tried echoing out $row2, but the word array is printed to the screen and nothing else.</p>
  
  <pre><code>&lt;?php
  session_start();
  if (isset($_GET["cmd"]))
    $cmd = $_GET["cmd"];
  else
    die("You should have a 'cmd' parameter in your URL");
   $pk = $_GET["pk"];
  $con = mysql_connect("localhost","root","geheim");
  if(!$con)
  {
  die('Connection failed because of' .mysql_error());
  }
  mysql_select_db("ebay",$con);
  if($cmd=="GetAuctionData")
  {
  $sql="SELECT * FROM Auctions WHERE ARTICLE_NO ='$pk'";
  $sql2="SELECT ARTICLE_DESC FROM Auctions WHERE ARTICLE_NO ='$pk'";
  $htmlset = mysql_query($sql2);
  $row2 = mysql_fetch_array($htmlset);
  echo $row2;
  echo '&lt;script&gt; 
  function makewindows(){
  child1 = window.open ("about:blank");
  child1.document.write('.$row2["ARTICLE_DESC"].');
  child1.document.close(); 
  }
  &lt;/script&gt;';
  
  $result = mysql_query($sql);
  while ($row = mysql_fetch_array($result))
  {
  echo "&lt;div id='leftlayer'&gt;
      &lt;strong&gt;Article Number&lt;/strong&gt; ".$row['ARTICLE_NO']."
      &lt;p&gt;&lt;strong&gt;Article Name&lt;/strong&gt;&lt;/p&gt; ".$row['ARTICLE_NAME']."
      &lt;p&gt;&lt;strong&gt;Subtitle&lt;/strong&gt;&lt;/p&gt; ".$row['SUBTITLE']."
      &lt;p&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/p&gt; ".$row['USERNAME']."
      &lt;p&gt;&lt;strong&gt;Total Selling&lt;/strong&gt;&lt;/p&gt; ".$row['QUANT_TOTAL']."
      &lt;p&gt;&lt;strong&gt;Total Sold&lt;/strong&gt;&lt;/p&gt; ".$row['QUANT_SOLD']."
      &lt;p&gt;&lt;strong&gt;Category&lt;/strong&gt;&lt;/p&gt; ".$row['CATEGORY']."
      &lt;p&gt;&lt;strong&gt;Highest Bidder&lt;/strong&gt;&lt;/p&gt; ".$row['BEST_BIDDER_ID']."
    &lt;/div&gt;
  &lt;div class='leftlayer2'&gt;
    &lt;strong&gt;Current Bid&lt;/strong&gt; ".$row['CURRENT_BID']."
    &lt;p&gt;&lt;strong&gt;Start Price&lt;/strong&gt;&lt;/p&gt; ".$row['START_PRICE']."
    &lt;p&gt;&lt;strong&gt;Buyitnow Price&lt;/strong&gt;&lt;/p&gt; ".$row['BUYITNOW_PRICE']."
    &lt;p&gt;&lt;strong&gt;Bid Count&lt;/strong&gt;&lt;/p&gt; ".$row['BID_COUNT']."
    &lt;p&gt;&lt;strong&gt;Start Date&lt;/strong&gt;&lt;/p&gt; ".$row['ACCESSSTARTS']."
    &lt;p&gt;&lt;strong&gt;End Date&lt;/strong&gt;&lt;/p&gt; ".$row['ACCESSENDS']."
    &lt;p&gt;&lt;strong&gt;Original End&lt;/strong&gt;&lt;/p&gt; ".$row['ACCESSORIGIN_END']."
    &lt;p&gt;&lt;strong&gt;Auction Type&lt;/strong&gt;&lt;/p&gt; ".$row['AUCTION_TYPE']."
  &lt;/div&gt;
  &lt;div class='leftlayer2'&gt;
      &lt;strong&gt;Private Auction&lt;/strong&gt;&lt;/p&gt; ".$row['PRIVATE_AUCTION']."
    &lt;p&gt;&lt;strong&gt;Paypal Accepted&lt;/strong&gt;&lt;/p&gt; ".$row['PAYPAL_ACCEPT']."
    &lt;p&gt;&lt;strong&gt;Auction Watched&lt;/strong&gt;&lt;/p&gt; ".$row['WATCH']."
    &lt;p&gt;&lt;strong&gt;Finished&lt;/strong&gt;&lt;/p&gt; ".$row['FINISHED']."
    &lt;p&gt;&lt;strong&gt;Country&lt;/strong&gt;&lt;/p&gt; ".$row['COUNTRYCODE']."
    &lt;p&gt;&lt;strong&gt;Location&lt;/strong&gt;&lt;/p&gt; ".$row['LOCATION']."
    &lt;p&gt;&lt;strong&gt;Conditions&lt;/strong&gt;&lt;/p&gt; ".$row['CONDITIONS']."
  &lt;/div&gt;
  &lt;div class='leftlayer2'&gt;
    &lt;strong&gt;Auction Revised&lt;/strong&gt;&lt;/p&gt; ".$row['REVISED']."
    &lt;p&gt;&lt;strong&gt;Cancelled&lt;/strong&gt;&lt;/p&gt; ".$row['PRE_TERMINATED']."
    &lt;p&gt;&lt;strong&gt;Shipping to&lt;/strong&gt;&lt;/p&gt; ".$row['SHIPPING_TO']."
    &lt;p&gt;&lt;strong&gt;Fee Insertion&lt;/strong&gt;&lt;/p&gt; ".$row['FEE_INSERTION']."
    &lt;p&gt;&lt;strong&gt;Fee Final&lt;/strong&gt;&lt;/p&gt; ".$row['FEE_FINAL']."
    &lt;p&gt;&lt;strong&gt;Fee Listing&lt;/strong&gt;&lt;/p&gt; ".$row['FEE_LISTING']."
    &lt;p&gt;&lt;a href='#' onclick='makewindows(); return false;'&gt;Click for full description &lt;/a&gt;&lt;/p&gt;
  &lt;/div&gt;";
  
  $lastImg = $row['PIC_URL'];
  echo "&lt;div id='rightlayer'&gt;Picture Picture
  &lt;img src=".$lastImg."&gt;
  &lt;/div&gt;";
  
  }
  
  }
  mysql_close($con);
  ?&gt;
  </code></pre>
  
  <p>edit: I have fixed the errors that Roborg pointed out, however the script will still not load and does not give a precise error.</p>
  
  <p>i have updated the code above</p>