Validating string before saving in to the database - Php

Validate data

Snippet Code


  
Rate this page :
  [ 0 votes]

While adding the contents into the mysql database care should be taken to ensure that quotation marks are escaped.mysql_real_escape_string($content) will add a escape character before the quotation mark.

$content="people's republic of china"; $content=mysql_real_escape_string($content);

Tags


Ask Questions

Ask Question