title: MySQL wont add rows to table via php Steam chat
body: <p>I am trying to make a chat for my steam site, but anytime I try to post something it won't add it to my database. Here is the code I'm running: </p>
  
  <pre><code>    &lt;?php
                          //Connect to database
                          include ('steamauth/userInfo.php');
                          $link = mysqli_connect("*******", "********", "*******", "******") or die("Error" . $link-&gt;connect_error);
                          //Form var
                          $name = $steamprofile['personaname'];
                          @$text = $_POST["text"];
                          //Error messages
                          $notext = "&lt;p&gt;&lt;strong&gt;Enter Text&lt;/strong&gt;&lt;/p&gt;";
  
                          //On submit
                          if(@$_POST['submit']){
                              if(!$text){
                                  @$errors .= $notext;
                              }else{
                                  $text = filter_var($text, FILTER_SANITIZE_STRING);
                              }
  
                              if(@$errors){
                                  echo "&lt;div class='errors'&gt; " . $errors ."&lt;/div&gt;";
                              }else{
                                  //No errors, prepare database
                                  $tblname = "Messages";
                                  $name = mysqli_real_escape_string($link, $name);
                                  $text = mysqli_real_escape_string($link, $text);
                                  //Insert into database
                                  $sql = "INSERT INTO Messages (text, name) VALUES ('$text', '$name')";
                                  mysqli_query($link, $sql);
                              }
                          }
                      ?&gt;
  &lt;?php
                  if(isset($_SESSION['steamid'])){
                  echo "&lt;div id='send'&gt;
                      &lt;form action='#' method='post'&gt;
                          &lt;input type='text' id='text' placeholder='Send Message ...' class='input' name='text'&gt;
                          &lt;input type='submit' id='submit' value=''&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;";
                  }else{
                      echo "&lt;div class='error' id='chat_log_in'&gt;Please Log In&lt;/br&gt;to chat&lt;/div&gt;";
                  }
                  ?&gt;
  </code></pre>
  
  <p>I'd say there is something wrong with the $name variable. Can anyone tell me what I did wrong in here please.</p>