scotchegg78 Posted October 9, 2008 Share Posted October 9, 2008 mysqli_real_escape_string does nothing here... $this->description = filter_var($_POST['description'],FILTER_SANITIZE_STRING); echo $this->description = mysqli_real_escape_string($this->db_link,$this->description); but works here.. echo mysqli_real_escape_string($this->db_link,"tt't"); $this->description is just a text string from a form. Link to comment https://forums.phpfreaks.com/topic/127682-what-dumb-thing-am-i-doing-mysqli_real_escape_string-on-this-variable/ Share on other sites More sharing options...
trq Posted October 9, 2008 Share Posted October 9, 2008 You cant echo and assign at the same time. Link to comment https://forums.phpfreaks.com/topic/127682-what-dumb-thing-am-i-doing-mysqli_real_escape_string-on-this-variable/#findComment-660797 Share on other sites More sharing options...
scotchegg78 Posted October 9, 2008 Author Share Posted October 9, 2008 what ? Yes you can ? I have realised I do not need to use mysqli_real_escape_string as I have used the php filter_input function already, which has turned the single quote into ' , hence mysqli_real_escape_string is not picking it up. Pretty sure thats it. Link to comment https://forums.phpfreaks.com/topic/127682-what-dumb-thing-am-i-doing-mysqli_real_escape_string-on-this-variable/#findComment-660812 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.