Topic: escape string (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28751" title="Pages that link to Topic: escape string (Page 1 of 1)" rel="nofollow" >Topic: escape string <span class="small">(Page 1 of 1)</span>\

 
redroy
Paranoid (IV) Inmate

From: 1393
Insane since: Dec 2003

posted posted 12-20-2006 05:16

If I escape a string with something like

code:
format_data($string){
if(function_exists("mysql_real_escape_string"))
{
    $string = mysql_real_escape_string($string);
}
else
{
    $string = addslashes($string);
}
return $string;}

Should I be able to see the "escaping" characters in the database? For example "redroy's house" would be seen in the database as "redroy\'s house". Using like this

code:
$var = format_data($_POST['var']);
mysql_query("INSERT INTO table VALUES ($var)");



edit: tried to make question more clear



(Edited by redroy on 12-20-2006 05:22)

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 12-20-2006 09:03

No you shouldn't. They are not stored in the database - they are only used for escaping in-band characters in sql.

redroy
Paranoid (IV) Inmate

From: 1393
Insane since: Dec 2003

posted posted 12-20-2006 18:01

Excellent thanks! I thought I was loosing my mind



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu