title: Data from mysql database in to text fields via php?
body: <p>I've created a database with a table called <strong>pages</strong> in it.</p>
  
  <p>Within this table there are fields called <strong>pages_id</strong>, <strong>pagename</strong>, <strong>pagedesc</strong>, <strong>pagekey</strong> and <strong>pagecont</strong>.</p>
  
  <p>How can I pull the data from these fields in the database, in to editable text fields? I've tried below, but my code isn't working :(</p>
  
  <pre><code>&lt;?php
  // Make a MySQL Connection
  mysql_connect("####", "####", "####") or die(mysql_error());
  mysql_select_db("####") or die(mysql_error());
  
  // Get all the data from the "example" table
  $result = mysql_query("SELECT * FROM pages") 
  or die(mysql_error());  
  
  ?&gt;
  &lt;p&gt;Page title&lt;/p&gt;&lt;br /&gt;
  &lt;?php echo"&lt;input name=\"pagename\" type=\"text\" id=\"pagename\" value=\"" .$pagename. "\"&gt;"; ?&gt;
  
  &lt;p&gt;Keywords&lt;/p&gt;&lt;br /&gt;
    &lt;?php echo"&lt;input name=\"pagekey\" type=\"text\" id=\"pagekey\" value=\"" .$pagekey. "\"&gt;"; ?&gt;
  
  &lt;p&gt;Description&lt;/p&gt;&lt;br /&gt;
  &lt;?php echo"&lt;input name=\"pagedesc\" type=\"text\" id=\"pagedesc\" value=\"" .$pagedesc. "\"&gt;"; ?&gt;
  
  &lt;p&gt;Content&lt;/p&gt;&lt;br /&gt;
  &lt;?php echo "&lt;textarea name=\"pagecont\" cols=\"120\" rows=\"20\" id=\"pagecont\" &gt;".$pagecont."&lt;/textarea&gt;";?&gt;
  </code></pre>