title: how to write text in textbox from database in php
body: <p>I have a form where I am getting values from previous page in $GET. I want to fetch around 3 different values from database and display them in textbox. How will I do it? Following is my code for getting data from database.</p>
  
  <pre><code>&lt;?php
  require_once('config.php');
  $id = $_GET['id'];
  $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
  if(!$link) {
          die('Failed to connect to server: ' . mysql_error());
  }
  
  //Select database
  $db = mysql_select_db(DB_DATABASE);
  if(!$db) {
          die("Unable to select database");
  }
  $query = "select question,price,sequence from questions where status = 1 and qid =".$id;
  //echo $query;
  $result=mysql_query($query);
  if (!$result) {
      die('Invalid query: ' . mysql_error());
  }
  $num_rows = mysql_num_rows($result);
  if($num_rows==0) {
   echo '&lt;center&gt;&lt;font color="red"&gt;&lt;b&gt;No record found!!&lt;/b&gt;&lt;/font&gt;&lt;/center&gt;';
  }
  else {
  $row = mysql_fetch_array($result);
  echo $row['question'];
  echo $row['sequence'];
  echo $row['price'];
  }
  </code></pre>
  
  <p>?></p>
  
  <p>Thanks<br>
  Pankaj</p>