Xyphon Posted August 25, 2008 Share Posted August 25, 2008 I have a very important question revolving around this function.. When do you need to use mysql_real_escape_string. Do you only need to use it in text, or all $_POST or $_GET. Because you can only hack with text, so is there any need to use it anywhere else? Thank you, Xyphon. Link to comment https://forums.phpfreaks.com/topic/121324-solved-mysql_real_escape_string/ Share on other sites More sharing options...
trq Posted August 25, 2008 Share Posted August 25, 2008 It needs to be used on any (and all) user inputted (or user has influence over) data you intend to use within an sql query. Link to comment https://forums.phpfreaks.com/topic/121324-solved-mysql_real_escape_string/#findComment-625506 Share on other sites More sharing options...
Xyphon Posted August 25, 2008 Author Share Posted August 25, 2008 So lets say there was a button that let them use an attack in battle, I'd have to real_escape_string it? Link to comment https://forums.phpfreaks.com/topic/121324-solved-mysql_real_escape_string/#findComment-625509 Share on other sites More sharing options...
PFMaBiSmAd Posted August 26, 2008 Share Posted August 26, 2008 Any $_POST, $_FILES, $_GET, or $_COOKIE data sent to your code can be manipulated and needs to be escaped if put into an sql query to prevent sql injection and to prevent broken queries should that data contain any special characters. Link to comment https://forums.phpfreaks.com/topic/121324-solved-mysql_real_escape_string/#findComment-625525 Share on other sites More sharing options...
Xyphon Posted August 26, 2008 Author Share Posted August 26, 2008 Oh so as long as its no in a query, it's okay? Link to comment https://forums.phpfreaks.com/topic/121324-solved-mysql_real_escape_string/#findComment-625526 Share on other sites More sharing options...
trq Posted August 26, 2008 Share Posted August 26, 2008 Oh so as long as its no in a query, it's okay? Yes, mysql_real_escape_string() is used to escape data intended for a query. Link to comment https://forums.phpfreaks.com/topic/121324-solved-mysql_real_escape_string/#findComment-625534 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.