title: database field data not appearing in form textbox in PHP
body: <p>i have this code in PHP and a database sql.. the situation is .. if i type the 1, 2 or 3 (productID) .. the textbox will be populated and field with database values.. but when i run the program.. fortunately it has no errors.. but when i type the id or 1 and click the submit button.. it doesnt get the neccessary values.. sorry for this im a complete newbie and im practicing PHP for a while now.. any help will do.. thank you..</p>
  
  <pre><code>&lt;?php
  session_start();
  include_once 'dbconnect.php';
  
  if(!isset($_SESSION['user'])){
  header("Location: index.php");
  }
  
  $res = mysql_query("SELECT * FROM users WHERE user_id=".$_SESSION['user']);
  $userRow = mysql_fetch_array($res);
  ?&gt;
  
  &lt;?php
  require('dbconnect.php');
  $id = (isset($_REQUEST['productID']));
  
  $result = mysql_query("SELECT * FROM tblstore WHERE productID = '$id'");
  $sql = mysql_fetch_array($result);
  
  if(!$result){
  die("Error: Data not found");
  } else {
  $brandname = $sql['brandname'];
  $price = $sql['price'];
  $stocks = $sql['stocks'];
  }
  
  ?&gt;
  
  &lt;html&gt;
  &lt;body&gt;
  &lt;p&gt;
  hi' &lt;?php echo $userRow['username']; ?&gt;&amp;nbsp;&lt;a href="logout.php?logout"&gt;Sign Out&lt;/a&gt;
  &lt;/p&gt;
  
  &lt;form method="post"&gt;
  &lt;table align="center"&gt;
  &lt;tr&gt;
  &lt;td&gt;Search Apparel:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="search" name="productID" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Brandname:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="brandname" value="&lt;?php echo $brandname; ?&gt;"/ &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Price:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="price" value="&lt;?php echo $price; ?&gt;"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Stocks:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="stocks" value="&lt;?php echo $stocks; ?&gt;"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" name="submit" value="Search" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>