title: How to use $_Get to store its values in a database?
body: <p>I want to display all users that a "super" user is responsible for. Then the "super" user can send a comment to any of the users by clicking on their user id.</p>
  
  <p>The first part of showing all the users is working fine! My problem is in sending a comment by the super user. I want to store the user id (ie <code>suid</code>) in the database. So I think to use the <code>$_Get</code> function. But when I tried it, nothing stores in the database. I think I made a mistake in it. So can anyone help me on that?</p>
  
  <p>This is the code that will show all users to the super user:</p>
  
  <pre><code>    &lt;?php
  
  session_start();?&gt;
  &lt;?php
  require("noCache.php");
  $uid=$_SESSION['uid'];
  
  ?&gt;
  &lt;html&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;title&gt;Send a comment&lt;/title&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;link rel="stylesheet" href="css/reset.css" type="text/css" media="all"&gt;
  &lt;link rel="stylesheet" href="css/layout.css" type="text/css" media="all"&gt;
  &lt;link rel="stylesheet" href="css/style.css" type="text/css" media="all"&gt;
  &lt;script type="text/javascript" src="js/jquery-1.4.2.js" &gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/cufon-yui.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/cufon-replace.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/Myriad_Pro_400.font.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/Myriad_Pro_700.font.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/Myriad_Pro_600.font.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
  &lt;div class="main"&gt;
  
      &lt;header&gt;
          &lt;div class="wrapper"&gt;
              &lt;h1&gt;&lt;a href="index.php" id="logo"&gt; Biz&lt;/a&gt;&lt;/h1&gt;
  
          &lt;/div&gt;
          &lt;nav&gt;
              &lt;ul id="menu"&gt;
                  &lt;li class="alpha"&gt;&lt;a href="index.php"&gt;&lt;span&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="About.html"&gt;&lt;span&gt;&lt;span&gt;About&lt;/span&gt;&lt;/span&gt; &lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="Projects.html"&gt;&lt;span&gt;&lt;span&gt;Projects&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="Contacts.php"&gt;&lt;span&gt;&lt;span&gt;Contacts&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="omega"&gt;&lt;a href="Services.html"&gt;&lt;span&gt;&lt;span&gt;Services&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/nav&gt;
          &lt;/br&gt;&lt;/br&gt;
  
  &lt;/header&gt;
  
  
  &lt;head&gt;
  &lt;!-- CSS Stylesheet --&gt;
  &lt;style type="text/css"&gt;
  html{
  
  }
  body{
      text-align:center;
  
  }
  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;?php
  $dbh=mysql_connect("localhost", "root", "hahaha1") or die (mysql_error());
  mysql_select_db ("senior");
  $result = mysql_query("SELECT * FROM sensorusers where uid=$uid");
  echo "&lt;html&gt;&lt;body&gt;";
  echo "&lt;table cellspacing=10 cellpadding=5 &gt;&lt;tr&gt; &lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Username&lt;/th&gt;&lt;th&gt;Password&lt;/th&gt;&lt;th&gt;Date of Registeration&lt;/th&gt;&lt;th&gt;Phone&lt;/th&gt;&lt;/tr&gt;";
  while ($row = mysql_fetch_array($result))
  {   echo "&lt;form method='post' action='sendcomment.php'&gt;";
      echo "&lt;tr&gt;&lt;td&gt;&lt;input type='submit' name='suid' value='".$row['suid']."' /&gt;&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['name'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['dusername'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['password'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['date'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['phone'] . "&lt;/td&gt;&lt;/tr&gt;&lt;/form&gt;";
      $_GET['suid'] = $row['suid'];
  }
  
  echo "&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;";
  mysql_close($dbh);
  ?&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;!-- CSS Stylesheet --&gt;
  &lt;style type="text/css"&gt;
  
  body {
  
      font-family:"Andalus"
      font: 16px ;
      color:black;
      padding: 30px 5px;
      text-align: center;
  }
  
  &lt;/style&gt;&lt;/body&gt;&lt;/html&gt; 
  </code></pre>
  
  <p>Here is the part that I want to ask about:</p>
  
  <pre><code>echo "&lt;table cellspacing=10 cellpadding=5 &gt;&lt;tr&gt; &lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Username&lt;/th&gt;&lt;th&gt;Password&lt;/th&gt;&lt;th&gt;Date of Registeration&lt;/th&gt;&lt;th&gt;Phone&lt;/th&gt;&lt;/tr&gt;";
  while ($row = mysql_fetch_array($result))
  {   echo "&lt;form method='post' action='sendcomment.php'&gt;";
      echo "&lt;tr&gt;&lt;td&gt;&lt;input type='submit' name='suid' value='".$row['suid']."' /&gt;&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['name'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['dusername'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['password'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['date'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['phone'] . "&lt;/td&gt;&lt;/tr&gt;&lt;/form&gt;";
      $_GET['suid'] = $row['suid'];
  }
  </code></pre>
  
  <p><strong>Solution:</strong></p>
  
  <p>Thank you all for helping. I fixed the code. I used method <code>post</code> to save the value of <code>suid</code> the first time. Then I print it as a hidden input. Finally I save the value of the hidden input in the sql and it works!</p>