title: I need a better way to stop hackers from inserting fatal data into my database
body: <p>I currently have a guest book on my site. It is very basic. Recently I have been doubting whether my current method of sanitizing the input added to the database is secure enough. Here is the current snippet of the code that collects the data and sanitizes it:</p>
  
  <pre><code>$name=$_POST['name'];
  $c_name=mysql_real_escape_string(htmlspecialchars($name));
  $detail=mysql_real_escape_string(htmlspecialchars($_POST['detail']));
  </code></pre>
  
  <p>Then obviously I would send the data to the server and place them in the necessary tables. Is this way efficient or are there any security holes I should be aware of? Thanks!</p>