title: PHP script not writing data into database
body: <p>I have this code from another Stack Overflow question answered <a href="https://stackoverflow.com/questions/3451073/how-do-i-collect-information-about-my-websites-visitors">here</a>.</p>
  
  <p>I have a mysql table called track in my database. </p>
  
  <pre><code>$server = "host";
  $username = "user";
  $password = "pass";
  $database = "database";
  
  $connId = mysql_connect($server,$username,$password) or die("Cannot connect to     server");
  $selectDb = mysql_select_db($database,$connId) or die("Cannot connect to database");
  
  
  $tracking_page_name="example";
  $ref=$_SERVER['HTTP_REFERER'];
  $agent=$_SERVER['HTTP_USER_AGENT'];
  $ip=$_SERVER['REMOTE_ADDR'];
  $host_name = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  $strSQL = "INSERT INTO track (tm, ref, agent, ip, tracking_page_name, host_name)         VALUES(curdate(),'$ref','$agent','$ip','$tracking_page_name','$host_name')";
  $test=mysql_query($strSQL);
  </code></pre>
  
  <p>Basically I want all the data this script collects to be put into my database. However, no matter what I type, even if I change the variables to text, nothing gets written into the database. I can read from the database just fine using another script, but I can't get this one to add any piece of info to the db. Is there a typo I just can't seem to find?</p>
  
  <p>I just want information about anyone who visits the page this gets included in.</p>
  
  <p>EDIT: I was trying to fill a field called "host_name", but in my database it had a different name. The original script shown here would not show the error and I did not ever run a check to see if all my fields are in order. That was the error. </p>