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? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted November 24, 2008 Share Posted November 24, 2008 huh? Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.