title: Can´t read out pictures out of database, because using foreign key
body: <p>My Database has a table (a) where i have a id as PK and a table for images (output_images), which contents id from (a) as foreign key.</p>
  
  <p><strong>output_images table:</strong></p>
  
  <pre><code>image_id tinyint(3) NOT NULL AUTO_INCREMENT,
  
  image_type varchar(25) NOT NULL,
  
  imageData   mediumblob BINARY
  
  a_ID int(11)
  </code></pre>
  
  <p><strong>image.php</strong> to get every image out of database:</p>
  
  <pre><code>&lt;?php
  mysql_connect("... .com","user","pw");
  mysql_select_db("database");
  if(isset($_GET['image_id'])) {
  $sql = "SELECT imageType,imageData FROM output_images, a WHERE 
  output_images.a_ID=a.a_ID" . $_GET['image_id'];
  $result = mysql_query("$sql") or die("&lt;b&gt;Error:&lt;/b&gt; Problem on Retrieving Image BLOB&lt;br/&gt;" . mysql_error());
  $row = mysql_fetch_array($result);
  header("Content-type: " . $row["imageType"]);
  echo $row["imageData"];
  }
  mysql_close();
  ?&gt;
  </code></pre>
  
  <p><strong>listimages.php</strong> calls image.php to build a list of images:</p>
  
  <pre><code>        &lt;?php
          mysql_connect("... .com","user","pw");
          mysql_select_db("database");
          $sql = "SELECT imageId FROM output_images,a Where output_images.a_ID=a.a_ID ORDER BY imageId DESC"; 
          $result = mysql_query($sql);
          ?&gt;
          &lt;HTML&gt;
          &lt;HEAD&gt;
          &lt;TITLE&gt;List BLOB Images&lt;/TITLE&gt;
          &lt;link href="imageStyles.css" rel="stylesheet" type="text/css" /&gt;
          &lt;/HEAD&gt;
          &lt;BODY&gt;
          &lt;?php
          while($row = mysql_fetch_array($result) or die (mysql_error()) 
          {
          ?&gt;
          &lt;img src="image.php?image_id=&lt;?php echo $row["imageId"]; ?&gt;" /&gt;&lt;br/&gt;
          &lt;?php       
          }
          mysql_close();
          ?&gt;
          &lt;/BODY&gt;
          &lt;/HTML&gt;
  </code></pre>
  
  <p>actual error message:</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '{' in 
    home/a9996478/public_html/listImages.php on line 15</p>
    
    <p>if i change the fifth line of listImages.php to:</p>
  </blockquote>
  
  <pre><code>$sql = "SELECT imageId FROM output_images ORDER BY imageId DESC";
  </code></pre>
  
  <p>i get the same problems, even i also get before for this line 12 broken pics </p>
  
  <p>i don´t know whats the problem....</p>