monkeypaw201 Posted November 24, 2008 Share Posted November 24, 2008 This is probably a simple question but my MySQL insert errors out when it encounters content that has a / is there a way to have it ignore it or something? Link to comment https://forums.phpfreaks.com/topic/133984-workaround-for-in-mysql-insert/ Share on other sites More sharing options...
Lodius2000 Posted November 24, 2008 Share Posted November 24, 2008 look up add slashes or mysql_real_escape_string ALWAYS ESCAPE YOUR DATA - not yelling just emphasising Link to comment https://forums.phpfreaks.com/topic/133984-workaround-for-in-mysql-insert/#findComment-697427 Share on other sites More sharing options...
monkeypaw201 Posted November 24, 2008 Author Share Posted November 24, 2008 So, how would i clean a query that is being copied somewhere else? Link to comment https://forums.phpfreaks.com/topic/133984-workaround-for-in-mysql-insert/#findComment-697430 Share on other sites More sharing options...
Lodius2000 Posted November 24, 2008 Share Posted November 24, 2008 huh? Link to comment https://forums.phpfreaks.com/topic/133984-workaround-for-in-mysql-insert/#findComment-697432 Share on other sites More sharing options...
monkeypaw201 Posted November 24, 2008 Author Share Posted November 24, 2008 lol, Ok, so i have a script that pulls it out of one table and inserts it into the other (don't ask why.. it just does.. ) , how would i use mysql_real_escape_string when everything is queried as its being inserted.. EXAMPLE: $result= mysql_query("SELECT * FROM `table`") or die(mysql_error()); $row_result= mysql_fetch_array($result); mysql_query("INSET INTO`table2` ('column','column2') VALUES ('$row_result[column]','$row_result[column]')"); how would i clean it? Link to comment https://forums.phpfreaks.com/topic/133984-workaround-for-in-mysql-insert/#findComment-697433 Share on other sites More sharing options...
Lodius2000 Posted November 24, 2008 Share Posted November 24, 2008 hrm, dunno man I use peardb so i dont really know my mysql functions too well, but i think but you would have to find a way to apply MRES to all of the elements of the $row_result array Link to comment https://forums.phpfreaks.com/topic/133984-workaround-for-in-mysql-insert/#findComment-697439 Share on other sites More sharing options...
elite_prodigy Posted November 24, 2008 Share Posted November 24, 2008 Escape the data before you put it into the new table. If you escaped it before you put it into the old tabel, I shouldn't think you'd have to escape it again.... Link to comment https://forums.phpfreaks.com/topic/133984-workaround-for-in-mysql-insert/#findComment-697607 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.