title: How do I set a php variable as one of the columns in my workbench database? Example: $ student = cd_student
body: <p>I want to make a simple database system for my school (activity) and I need to get, for example, the name that the guy put in the first text box, take this information, say the name of student = nm_student, Store that data, and display all the information that he typed on the screen. I was able to get these items but I could not store these data in the contents of my MySQL column, so if someone can help me, I would appreciate it</p>
  
  <p>What I need: </p>
  
  <pre><code>$name = nm_student
  
  $birth = dt_birth_student
  
  $rm = cd_rm_student 
  </code></pre>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/GNePJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GNePJ.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  
  &lt;/head&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;?php
  include("connect.php");
  ?&gt;
  
  &lt;form action="" method="POST"&gt;
    name:&lt;br&gt;
    &lt;input type="text" name="name" value=""&gt;
    &lt;br&gt;
    RM:&lt;br&gt;
    &lt;input type="text" name="RM" value=""&gt;
    &lt;br&gt;&lt;br&gt;
    Data of birth: &lt;br&gt;
    &lt;input type="date" name="birth" value=""&gt;
    &lt;br&gt;&lt;br&gt;
    &lt;a href=""&gt;&lt;input type="submit"  name="register" value="register"&gt;&lt;/a&gt;
  &lt;/form&gt; 
  &lt;br&gt;
  &lt;?php
  include("select.php");    
  ?&gt;    
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>PHP: CONNECT CODE</p>
  
  <pre><code>$conn = mysqli_connect("localhost","root","root","student");
  
  if($conn-&gt;connect_error){
      die("connection fail" . $conn-&gt;connect_error);
  }
  </code></pre>
  
  <p>PHP: SELECT CODE</p>
  
  <pre><code>&lt;?php
  include("connect.php");
  
  $sql = "SELECT * FROM student";
  
  $result = $conn-&gt;query($sql);
  
  
  if(isset($_POST["register"])){
      $name = $_POST ["name"];
      $rm = $_POST ["rm"];
      $birth = $_POST ["birth"];
  }
  
  ?&gt;
  </code></pre>
  
  <p>MY SQL WORKBENCH CODE:</p>
  
  <pre><code>create table student(
  cd_rm_student int,
  nm_student varchar(100),
  dt_birth_student date,
  CONSTRAINT PK_alunos PRIMARY KEY (cd_rm_student)
  );
  </code></pre>