// ### Prepare variable for MySQL ##################### // First, make sure there aren't any slashes. Then escape special chars (including quotes!) function prep_sqlvar($var) { // Stripslashes if(get_magic_quotes_gpc()) { $var = stripslashes($var); } $var = mysql_real_escape_string($value); return $var; }