Posts tagged ‘mysql escaping function’

MySql query containing single and double quotes strings error

There are cases when a php developers need to insert mysql data with strings which containing single or double quotes. Mysql  gives error or will not save data if we do not properly escape the string formation characters. To escape these characters php have a function {mysql_real_escape_string()}. This function can be used to format the mysql strings with escaping. e.g.

<?php

$escaped_mystring = mysql_real_escape_string($mystring);

?>

Now if you run the query after escaping it will save the string wit out any error.

Searched By:

mysql2 escape (3), c# mysql quote (2), mysqldata c# escape (1), php mysql search data single quotes (1), php save quotation single (1), php sql format (1), quote mysql vb6 (1), quote saving c# mysql (1), save quote to mysql (1), SAVE SINGLE QOUTE IN mysql (1), save single quote in php (1), send a string with apostrophe and double quote in php mysql (1), store a string with quotes in mysql (1), using double quotes in mysql query string (1), vb 2010 mysql escape character (1), mysql2 scape (1), c# escape string mysql (1), c# mysql hadling quotes in query text (1), c# quote mysql (1), csharp error mysql double (1)