title: Database form does display results
body: <p>I am having trouble displaying my results in the form. Could anyone show me what I am doing wrong? The only thing that is showing up is the echo Database Output. I am trying to create a database to update a webpage. I am suppose to go to the admin page which contains this form and should be able to add, delete and update the webpage any suggestions would help. Thanks in advance.</p>
  
  <pre><code>&lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  $id=$_POST['id'];
  $db="";
  $link = mysql_connect('localhost', '', '');
  if (! $link)
  die("Couldn't connect to MySQL");
  
  mysql_select_db($db , $link)
  or die("Couldn't open $db: ".mysql_error());
  
  $query=" SELECT * FROM tblContent WHERE PageID ='$id'";
  $result=mysql_query($query);
  
  $num=mysql_numrows($result);
  
  mysql_close();
  
  echo "&lt;b&gt;&lt;center&gt;Database Output&lt;/center&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;";
  
  $i=0;
  while ($i &lt; $num) {
  
  $pageHeading=mysql_result($result,$i,"PageHeading");
  $subHeading=mysql_result($result,$i,"SubHeading");
  $contentTxt=mysql_result($result,$i,"Content");
  $pageTitle=mysql_result($result,$i,"PageTitle");
  $metaDescription=mysql_result($result,$i,"MetaDescription");
  $metaKeywords=mysql_result($result,$i,"MetaKeywords");
  ?&gt;  
  &lt;form method="post" action="admin.php"&gt;
  &lt;input type="hidden" name="ud_id value="&lt;? echo $id; ?&gt;"&gt;                          
  LinkText: &lt;input type="text" name="ud_LinkText" value="&lt;? echo $contectTxt; ?&gt;"&gt;&lt;br&gt;
  Page Heading:&lt;input type="text" name="ud_PageHeading"  value="&lt;? echo $id; ?&gt;"&gt;
  Sub Heading:&lt;input type="text" name="ud_SubHeading" 
  value="&lt;? echo $subHeading; ?&gt;"&gt;&lt;br&gt;
  Page Title: &lt;input type="text" name="ud_PageTitle" value="&lt;? echo $pageTitle; ?&gt;"&gt;&lt;br&gt;
  MetaDescription: &lt;input type="text" name="ud_MetaDescription" 
  value="&lt;? echo $metaDescription; ?&gt;"&gt;&lt;br&gt;
  MetaKeywords: &lt;input type="text" name="ud_MetaKeywords" 
  value="&lt;? echo $metaKeywords; ?&gt;"&gt;&lt;br&gt;
  &lt;input type="Submit" value="Update"&gt;
  &lt;/form&gt;
  
  &lt;?php
  ++$i;
  }
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>