Topic: escape string (Page 1 of 1) Pages that link to <a href="http://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

IP logged posted posted 12-20-2006 05:16 Edit Quote

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

IP logged posted posted 12-20-2006 09:03 Edit Quote

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

IP logged posted posted 12-20-2006 18:01 Edit Quote

Excellent thanks! I thought I was loosing my mind



Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu